Skip to content

Commit 2c9f029

Browse files
ummakynesFlorian Westphal
authored and
Florian Westphal
committed
netfilter: nf_tables: flush pending destroy work before netlink notifier
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 <[email protected]> Signed-off-by: Florian Westphal <[email protected]>
1 parent 4b80ced commit 2c9f029

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nf_tables_api.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11073,7 +11073,7 @@ static int nft_rcv_nl_event(struct notifier_block *this, unsigned long event,
1107311073
gc_seq = nft_gc_seq_begin(nft_net);
1107411074

1107511075
if (!list_empty(&nf_tables_destroy_list))
11076-
rcu_barrier();
11076+
nf_tables_trans_destroy_flush_work();
1107711077
again:
1107811078
list_for_each_entry(table, &nft_net->tables, list) {
1107911079
if (nft_table_has_owner(table) &&

0 commit comments

Comments
 (0)