Skip to content

Commit bd05876

Browse files
Gavrilov Iliaummakynes
authored andcommitted
netfilter: nf_tables: Add null check for nla_nest_start_noflag() in nft_dump_basechain_hook()
The nla_nest_start_noflag() function may fail and return NULL; the return value needs to be checked. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d54725c ("netfilter: nf_tables: support for multiple devices per netdev hook") Signed-off-by: Gavrilov Ilia <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 9025944 commit bd05876

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,8 @@ static int nft_dump_basechain_hook(struct sk_buff *skb, int family,
16001600

16011601
if (nft_base_chain_netdev(family, ops->hooknum)) {
16021602
nest_devs = nla_nest_start_noflag(skb, NFTA_HOOK_DEVS);
1603+
if (!nest_devs)
1604+
goto nla_put_failure;
16031605

16041606
if (!hook_list)
16051607
hook_list = &basechain->hook_list;

0 commit comments

Comments
 (0)