CVE-2026-143377
not scored yetbpf: 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.
- Published
- 3 Dec 2026
- Last modified
- 3 Dec 2026
- Assigned by
- 416baaa9-dc9f-4396-8d5f-8c081fb06d67
- NVD status
- Received
- Sources
- NVDJSONCVE ListJSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| CVE List | Linux | Linux | >= 86fe28f7692d96d20232af0fc6d7632d5cc89a01, < 6ddc16d58b40bc3276dcd3f4027df5e9e846d26a; >= 86fe28f7692d96d20232af0fc6d7632d5cc89a01, < d7c38cf0acd70e1d6fe99a59b0b2afc235a9f7de; >= 86fe28f7692d96d20232af0fc6d7632d5cc89a01, < 1cd28b5354ab77c727ed87255bf289a87178b415 | 6ddc16d58b40bc3276dcd3f4027df5e9e846d26a, d7c38cf0acd70e1d6fe99a59b0b2afc235a9f7de, 1cd28b5354ab77c727ed87255bf289a87178b415 |
| CVE List | Linux | Linux | = 6.1 |
References
- https://git.kernel.org/stable/c/1cd28b5354ab77c727ed87255bf289a87178b415
- https://git.kernel.org/stable/c/6ddc16d58b40bc3276dcd3f4027df5e9e846d26a
- https://git.kernel.org/stable/c/d7c38cf0acd70e1d6fe99a59b0b2afc235a9f7de
History
- 3 Dec 2026 11:07 UTC · NVD: first stored (published 3 Dec 2026)
- 3 Dec 2026 10:08 UTC · CVE List: first stored (published 3 Dec 2026)