Skip to content

Commit 63df531

Browse files
committed
netfilter: nf_tables: flush pending destroy work before netlink notifier
jira VULN-430 cve CVE-2023-4244 commit-author Pablo Neira Ayuso <pablo@netfilter.org> commit 2c9f029 Destroy work waits for the RCU grace period then it releases the objects with no mutex held. All releases objects follow this path for transactions, therefore, order is guaranteed and references to top-level objects in the hierarchy remain valid. However, netlink notifier might interfer with pending destroy work. rcu_barrier() is not correct because objects are not release via RCU callback. Flush destroy work before releasing objects from netlink notifier path. Fixes: d4bc827 ("netfilter: nf_tables: netlink notifier might race to release objects") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de> (cherry picked from commit 2c9f029) Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
1 parent f6014c3 commit 63df531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10730,7 +10730,7 @@ static int nft_rcv_nl_event(struct notifier_block *this, unsigned long event,
1073010730
gc_seq = nft_gc_seq_begin(nft_net);
1073110731

1073210732
if (!list_empty(&nf_tables_destroy_list))
10733-
rcu_barrier();
10733+
nf_tables_trans_destroy_flush_work();
1073410734
again:
1073510735
list_for_each_entry(table, &nft_net->tables, list) {
1073610736
if (nft_table_has_owner(table) &&

0 commit comments

Comments
 (0)