CVE-2026-143377

Source
https://cve.org/CVERecord?id=CVE-2026-143377
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143377.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-143377
Downstream
Published
2026-12-03T09:22:25Z
Modified
2026-12-03T11:02:10Z
Summary
bpf: Drop percpu_counter from the htab element count
Details

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.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143377.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
86fe28f7692d96d20232af0fc6d7632d5cc89a01
Fixed
6ddc16d58b40bc3276dcd3f4027df5e9e846d26a
Fixed
d7c38cf0acd70e1d6fe99a59b0b2afc235a9f7de
Fixed
1cd28b5354ab77c727ed87255bf289a87178b415

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143377.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.1.0
Fixed
6.18.66
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.3.7

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143377.json"