Skip to content

Commit d4bc827

Browse files
committed
netfilter: nf_tables: netlink notifier might race to release objects
commit release path is invoked via call_rcu and it runs lockless to release the objects after rcu grace period. The netlink notifier handler might win race to remove objects that the transaction context is still referencing from the commit release path. Call rcu_barrier() to ensure pending rcu callbacks run to completion if the list of transactions to be destroyed is not empty. Fixes: 6001a93 ("netfilter: nftables: introduce table ownership") Reported-by: [email protected] Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 363a532 commit d4bc827

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/nf_tables_api.c

+2
Original file line numberDiff line numberDiff line change
@@ -10030,6 +10030,8 @@ static int nft_rcv_nl_event(struct notifier_block *this, unsigned long event,
1003010030
nft_net = nft_pernet(net);
1003110031
deleted = 0;
1003210032
mutex_lock(&nft_net->commit_mutex);
10033+
if (!list_empty(&nf_tables_destroy_list))
10034+
rcu_barrier();
1003310035
again:
1003410036
list_for_each_entry(table, &nft_net->tables, list) {
1003510037
if (nft_table_has_owner(table) &&

0 commit comments

Comments
 (0)