summaryrefslogtreecommitdiff
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2025-03-06 06:05:26 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2025-03-06 15:35:54 +0300
commitfb8286562ecfb585e26b033c5e32e6fb85efb0b3 (patch)
tree1da5bd98aa3a39080648a86132374cfde8dbe156 /net/switchdev/switchdev.c
parentdf08c94baafb001de6cf44bb7098bb557f36c335 (diff)
downloadlinux-fb8286562ecfb585e26b033c5e32e6fb85efb0b3.tar.xz
netfilter: nf_tables: make destruction work queue pernet
The call to flush_work before tearing down a table from the netlink notifier was supposed to make sure that all earlier updates (e.g. rule add) that might reference that table have been processed. Unfortunately, flush_work() waits for the last queued instance. This could be an instance that is different from the one that we must wait for. This is because transactions are protected with a pernet mutex, but the work item is global, so holding the transaction mutex doesn't prevent another netns from queueing more work. Make the work item pernet so that flush_work() will wait for all transactions queued from this netns. A welcome side effect is that we no longer need to wait for transaction objects from foreign netns. The gc work queue is still global. This seems to be ok because nft_set structures are reference counted and each container structure owns a reference on the net namespace. The destroy_list is still protected by a global spinlock rather than pernet one but the hold time is very short anyway. v2: call cancel_work_sync before reaping the remaining tables (Pablo). Fixes: 9f6958ba2e90 ("netfilter: nf_tables: unconditionally flush pending work before notifier") Reported-by: syzbot+5d8c5789c8cb076b2c25@syzkaller.appspotmail.com Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions