CVE-2026-143377: bpf: Drop percpu_counter from the htab element count

Published Dec 3, 2026
·
Updated

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

3 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.1.0<6.18.66
6.18.66
linux/kernel>=6.19.0<7.3.7
7.3.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.66
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.7

Event History

Dec 3, 2026
CVE Published
via MITRE·09:22 AM
Data Sourced
via MITRE·09:22 AM
Description
Data Sourced
via OSV·09:22 AM
DescriptionAffected Software
Data Sourced
via NVD·10:18 AM
Description

Frequently Asked Questions

1

Which BPF workloads are exposed to this locking issue?

The issue affects large non-preallocated BPF hash maps whose element count uses a percpu counter. It can be triggered by BPF programs running in NMI context or by programs attached to the contention_end tracepoint.

2

What must happen for the issue to trigger?

A BPF program must update the same affected hash map while the percpu-counter lock is held or contended on its CPU. The map-full check path is also affected because its counter comparison can fall back to the same locking path.

3

What can be done if the fix cannot be deployed immediately?

Avoid updating an affected map from NMI-context BPF programs or from programs attached to contention_end. In particular, do not have those programs update the same large non-preallocated hash map that can enter the percpu-counter slow path.

4

How can an administrator recognize that this is occurring?

Kernel logs may report a "possible recursive locking detected" warning. The reported stack can include percpu_counter_add_batch, alloc_htab_elem, htab_map_update_elem, queued_spin_lock_slowpath, and __bpf_trace_contention_end.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203