Linux Kernel BPF percpu_counter Raw Spin Lock Recursion Vulnerability
CVE-2026-143377 Published on December 3, 2026
bpf: Drop percpu_counter from the htab element count
In the Linux kernel, the following vulnerability has been resolved:
bpf: Drop percpu_counter from the htab element count
The element count of a large non-preallocated hash map is a
percpu_counter, whose slow path takes fbc->lock with
raw_spin_lock_irqsave(). That is not safe against BPF programs that run
while the lock is held or contended: NMI programs and, as
queued_spin_lock_slowpath() calls trace_contention_end() with the lock
already held, programs attached to the contention_end tracepoint. If such
a program updates the same map it spins on the lock its own CPU holds:
WARNING: possible recursive locking detected
cend/250 is trying to acquire lock:
(key#5){....}-{2:2}, at: _raw_spin_lock_irqsave+0x18/0x30
but task is already holding lock:
(key#5){....}-{2:2}, at: _raw_spin_lock_irqsave+0x18/0x30
percpu_counter_add_batch+0xd8/0x160
alloc_htab_elem+0x408/0x480
htab_map_update_elem+0x1e8/0x6a0
bpf_prog_7a29a1ae68aedf07_cend+0x14c/0x1f8
__bpf_trace_contention_end+0x14/0x20
queued_spin_lock_slowpath+0x2e8/0x468
percpu_counter_add_batch+0xd8/0x160
alloc_htab_elem+0x408/0x480
htab_map_update_elem+0x1e8/0x6a0
is_map_full() is affected too, as __percpu_counter_compare() falls back
to percpu_counter_sum(), which takes the same lock.
map.elem_count already is a lockless per-cpu count of the same elements.
Make htab->count follow it in steps of PERCPU_COUNTER_BATCH and let
is_map_full() sum elem_count once count is within nr_cpu_ids * batch of
max_entries. Each cpu's elem_count is ahead of count by less than the
batch, so that is exact, in NMI as well.
Products Associated with CVE-2026-143377
Want to know whenever a new CVE is published for Linux Kernel? stack.watch will email you.
Affected Versions
Linux:- Version 86fe28f7692d96d20232af0fc6d7632d5cc89a01 and below 6ddc16d58b40bc3276dcd3f4027df5e9e846d26a is affected.
- Version 86fe28f7692d96d20232af0fc6d7632d5cc89a01 and below d7c38cf0acd70e1d6fe99a59b0b2afc235a9f7de is affected.
- Version 86fe28f7692d96d20232af0fc6d7632d5cc89a01 and below 1cd28b5354ab77c727ed87255bf289a87178b415 is affected.
- Version 6.1 is affected.
- Before 6.1 is unaffected.
- Version 6.18.66, <= 6.18.* is unaffected.
- Version 7.3.7, <= 7.3.* is unaffected.
- Version 7.4-rc2, <= * is unaffected.
Exploit Probability
EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.