]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
netfilter: nf_tables: netlink notifier might race to release objects
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 26 Oct 2022 07:52:36 +0000 (09:52 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 6 Dec 2022 13:45:33 +0000 (14:45 +0100)
commitce1546fd3ebb8c79739a12ee7a06b14f1b9e844c
treeda76e269519fa2df64567ae8e962ec284e15331d
parentbd282a577dad3ace77d55587ded656c6c0673958
netfilter: nf_tables: netlink notifier might race to release objects

BugLink: https://bugs.launchpad.net/bugs/1998843
[ Upstream commit d4bc8271db21ea9f1c86a1ca4d64999f184d4aae ]

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: 6001a930ce03 ("netfilter: nftables: introduce table ownership")
Reported-by: syzbot+8f747f62763bc6c32916@syzkaller.appspotmail.com
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/netfilter/nf_tables_api.c