Skip to content

Commit 08cba4c

Browse files
CIQ Kernel Automationroxanan1996
authored andcommitted
netfilter: nf_tables: release flowtable after rcu grace period on error
jira VULN-179375 cve CVE-2026-23392 commit-author Pablo Neira Ayuso <pablo@netfilter.org> commit d73f4b5 Call synchronize_rcu() after unregistering the hooks from error path, since a hook that already refers to this flowtable can be already registered, exposing this flowtable to packet path and nfnetlink_hook control plane. This error path is rare, it should only happen by reaching the maximum number hooks or by failing to set up to hardware offload, just call synchronize_rcu(). There is a check for already used device hooks by different flowtable that could result in EEXIST at this late stage. The hook parser can be updated to perform this check earlier to this error path really becomes rarely exercised. Uncovered by KASAN reported as use-after-free from nfnetlink_hook path when dumping hooks. Fixes: 3b49e2e ("netfilter: nf_tables: add flow table netlink frontend") Reported-by: Yiming Qian <yimingqian591@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de> (cherry picked from commit d73f4b5) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent a2fb277 commit 08cba4c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8394,6 +8394,7 @@ static int nf_tables_newflowtable(struct sk_buff *skb,
83948394
return 0;
83958395

83968396
err_flowtable_hooks:
8397+
synchronize_rcu();
83978398
nft_trans_destroy(trans);
83988399
err_flowtable_trans:
83998400
nft_flowtable_hooks_destroy(&flowtable->hook_list);

0 commit comments

Comments
 (0)