]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_tables: flush pending destroy work before netlink notifier
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 17 Aug 2023 23:13:31 +0000 (01:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:18:15 +0000 (16:18 +0200)
commitf22954f8c58fd5f5489f5980796914e306757e77
treea5f0bad6636dae239381bf39ea7ac232abf4caee
parentff34403fef984a7d602e20ca77b26ff1a07fd13a
netfilter: nf_tables: flush pending destroy work before netlink notifier

[ Upstream commit 2c9f0293280e258606e54ed2b96fa71498432eae ]

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: d4bc8271db21 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_tables_api.c