CVE-2026-45897: netfilter: nft_counter: serialize reset with spinlock
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
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.
The Linux kernel CVE team has assigned CVE-2026-45897 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.7 with commit 3cb03edb4de33fd04c4ea55f47397b96a8657c53 and fixed in 6.19.4 with commit 0cdc6d5a26f2d1f7f15a43526841b679445c32e2 Issue introduced in 6.7 with commit 3cb03edb4de33fd04c4ea55f47397b96a8657c53 and fixed in 7.0 with commit 779c60a5190c42689534172f4b49e927c9959e4e Issue introduced in 6.1.107 with commit fb1adb05ea87b6149e65a31e511756c4f470d0cd Issue introduced in 6.6.48 with commit f123293db16dcd0cd81b246ae60e6362f0025d0a
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-45897
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/netfilter/nft_counter.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/0cdc6d5a26f2d1f7f15a43526841b679445c32e2 https://git.kernel.org/stable/c/779c60a5190c42689534172f4b49e927c9959e4e