]> git.dujemihanovic.xyz Git - linux.git/commit
netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests
authorPhil Sutter <phil@nwl.cc>
Fri, 9 Aug 2024 13:07:32 +0000 (15:07 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 14 Aug 2024 21:44:55 +0000 (23:44 +0200)
commitbd662c4218f9648e888bebde9468146965f3f8a0
tree42f14596e598d6c3fc7cf1e280dea8ff7808e5e6
parent69fc3e9e90f1afc11f4015e6b75d18ab9acee348
netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests

Objects' dump callbacks are not concurrency-safe per-se with reset bit
set. If two CPUs perform a reset at the same time, at least counter and
quota objects suffer from value underrun.

Prevent this by introducing dedicated locking callbacks for nfnetlink
and the asynchronous dump handling to serialize access.

Fixes: 43da04a593d8 ("netfilter: nf_tables: atomic dump and reset for stateful objects")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c