mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
netfilter: nf_tables: use kzalloc for hook allocation
[ Upstream commit195e5f88c2
] KMSAN reports unitialized variable when registering the hook, reg->hook_ops_type == NF_HOOK_OP_BPF) ~~~~~~~~~~~ undefined This is a small structure, just use kzalloc to make sure this won't happen again when new fields get added to nf_hook_ops. Fixes:7b4b2fa375
("netfilter: annotate nf_tables base hook ops") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f305359186
commit
ea33b81669
1 changed files with 1 additions and 1 deletions
|
@ -2059,7 +2059,7 @@ static struct nft_hook *nft_netdev_hook_alloc(struct net *net,
|
|||
struct nft_hook *hook;
|
||||
int err;
|
||||
|
||||
hook = kmalloc(sizeof(struct nft_hook), GFP_KERNEL_ACCOUNT);
|
||||
hook = kzalloc(sizeof(struct nft_hook), GFP_KERNEL_ACCOUNT);
|
||||
if (!hook) {
|
||||
err = -ENOMEM;
|
||||
goto err_hook_alloc;
|
||||
|
|
Loading…
Reference in a new issue