mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-18 22:34:48 +00:00
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: d54725cd11a5 ("netfilter: nf_tables: support for multiple devices per netdev hook") Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
9025944fdd
commit
bd058763a6
@ -1600,6 +1600,8 @@ static int nft_dump_basechain_hook(struct sk_buff *skb, int family,
|
||||
|
||||
if (nft_base_chain_netdev(family, ops->hooknum)) {
|
||||
nest_devs = nla_nest_start_noflag(skb, NFTA_HOOK_DEVS);
|
||||
if (!nest_devs)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (!hook_list)
|
||||
hook_list = &basechain->hook_list;
|
||||
|
Loading…
x
Reference in New Issue
Block a user