AZL-118700: CVE-2026-143377 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
bpf: Drop percpucounter from the htab element count
The element count of a large non-preallocated hash map is a percpucounter, whose slow path takes fbc->lock with rawspinlockirqsave(). That is not safe against BPF programs that run while the lock is held or contended: NMI programs and, as queuedspinlockslowpath() calls tracecontentionend() with the lock already held, programs attached to the contentionend 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: rawspinlockirqsave+0x18/0x30 but task is already holding lock: (key#5){....}-{2:2}, at: rawspinlockirqsave+0x18/0x30 percpucounteraddbatch+0xd8/0x160 allochtabelem+0x408/0x480 htabmapupdateelem+0x1e8/0x6a0 bpfprog7a29a1ae68aedf07cend+0x14c/0x1f8 bpftracecontentionend+0x14/0x20 queuedspinlockslowpath+0x2e8/0x468 percpucounteraddbatch+0xd8/0x160 allochtabelem+0x408/0x480 htabmapupdateelem+0x1e8/0x6a0
ismapfull() is affected too, as percpucountercompare() falls back to percpucountersum(), which takes the same lock.
map.elemcount already is a lockless per-cpu count of the same elements. Make htab->count follow it in steps of PERCPUCOUNTERBATCH and let ismapfull() sum elemcount once count is within nrcpuids batch of maxentries. Each cpu's elemcount is ahead of count by less than the batch, so that is exact, in NMI as well.
Affected Software
Event History
Frequently Asked Questions
What conditions are required to trigger the issue?
A BPF program must run in NMI context or be attached to the contention_end tracepoint, and it must update the same large non-preallocated hash map while that map's per-CPU element-count lock is held or contended.
Which BPF map operations are implicated?
Updates that allocate hash-map elements can reach the affected per-CPU counter path. Map-full checks are also affected because the counter comparison can fall back to the same locking behavior.
How can I identify a possible occurrence?
Kernel diagnostics may report a "possible recursive locking detected" warning involving _raw_spin_lock_irqsave, percpu_counter_add_batch, alloc_htab_elem, and htab_map_update_elem. For contention_end-triggered cases, the stack can also include __bpf_trace_contention_end and queued_spin_lock_slowpath.
What can be done if the resolved kernel version cannot be deployed immediately?
Avoid using BPF programs in NMI context or on the contention_end tracepoint when they update the same large non-preallocated hash map. This removes the execution scenario described for the recursive lock acquisition.