summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrian Witte <brianwitte@mailfence.com>2026-02-04 14:26:37 -0600
committerFlorian Westphal <fw@strlen.de>2026-02-17 15:04:20 +0100
commit779c60a5190c42689534172f4b49e927c9959e4e (patch)
tree93ec9f8dbfbba2ac41da75a3c467e423c6e2ac48 /include
parent07919126ecfc392102555a70016db3e591abcb3d (diff)
netfilter: nft_counter: serialize reset with spinlock
Add a global static spinlock to serialize counter fetch+reset operations, preventing concurrent dump-and-reset from underrunning values. The lock is taken before fetching the total so that two parallel resets cannot both read the same counter values and then both subtract them. A global lock is used for simplicity since resets are infrequent. If this becomes a bottleneck, it can be replaced with a per-net lock later. Fixes: bd662c4218f9 ("netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests") Fixes: 3d483faa6663 ("netfilter: nf_tables: Add locking for NFT_MSG_GETSETELEM_RESET requests") Fixes: 3cb03edb4de3 ("netfilter: nf_tables: Add locking for NFT_MSG_GETRULE_RESET requests") Suggested-by: Florian Westphal <fw@strlen.de> Signed-off-by: Brian Witte <brianwitte@mailfence.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions