]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: use kzalloc for hook allocation
authorFlorian Westphal <fw@strlen.de>
Wed, 21 Feb 2024 17:38:45 +0000 (18:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:35:09 +0000 (13:35 +0100)
commit73a7cdb487797f1b84822663c0fa3409bfb93b8a
tree26b73d7bd1b998c4b8b4cb350b60b55423ef87a5
parentfe9f4d1c531ae6271e8e0c12c6dc270bd9ce1b7e
netfilter: nf_tables: use kzalloc for hook allocation

[ Upstream commit 195e5f88c2e48330ba5483e0bad2de3b3fad484f ]

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: 7b4b2fa37587 ("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>
net/netfilter/nf_tables_api.c