CVE-2026-139317

bpf: Don't saturate owner_refcnt on the last unpin

Published Nov 30, 2026 CVSS 3.1 · 4.4 Medium EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Don't saturate owner_refcnt on the last unpin

bpf_local_storage_map_free() pins the owner with refcount_inc_not_zero()
while it uncharges an element. The pin counts when
bpf_local_storage_destroy() could not get local_storage->lock: destroy()
then goes on, drops the owner's reference and spins until the count is
zero. So the pin is the last reference whenever it is needed, and
refcount_dec() takes that for a bug: it warns "decrement hit 0; leaking
memory" and saturates the count. Unless destroy() happens to read the
count between the two stores it spins for ever, under rcu_read_lock().

Drop the pin with refcount_dec_and_test().

Analysis

AI-generated

Technical impact

This bug corresponds to CWE-401 (Memory Leak), and occurs when bpf_local_storage_map_free() pins a refcounted owner while removing an element. When bpf_local_storage_destroy() later drops the owner reference, the decrement can saturate the count, causing a warning for a zero decrement and leaking memory. The bug can also lead to indefinite spinning under RCU read locks, potentially exhausting kernel resources.

Affected Systems

The issue impacts the Linux kernel across all releases that include the affected bpf_local_storage code paths. Based on the CNA data, it is inferred that all systems where this logic exists are considered vulnerable.

Risk and Exploitability

Because the vulnerability results in a memory leak and possible denial of service without an external exploitation path, the risk is primarily for systems that can load or run kernel modules using BPF local storage. The EPSS score is not available, and the vulnerability is not listed in CISA KEV, indicating no known widespread exploitation. Local attackers with kernel access could force the condition, but external remote exploitation is not directly supported by the details provided.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel release that patches the bpf_local_storage refcount bug
  • If an immediate kernel update is not possible, temporarily disable or avoid using BPF local storage features until a patch is available
  • Monitor kernel logs for 'decrement hit 0' warnings to detect possible memory leaks

Generated by OpenCVE AI on December 1, 2026 at 07:44 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-911
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-401
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Don't saturate owner_refcnt on the last unpin bpf_local_storage_map_free() pins the owner with refcount_inc_not_zero() while it uncharges an element. The pin counts when bpf_local_storage_destroy() could not get local_storage->lock: destroy() then goes on, drops the owner's reference and spins until the count is zero. So the pin is the last reference whenever it is needed, and refcount_dec() takes that for a bug: it warns "decrement hit 0; leaking memory" and saturates the count. Unless destroy() happens to read the count between the two stores it spins for ever, under rcu_read_lock(). Drop the pin with refcount_dec_and_test().
Title bpf: Don't saturate owner_refcnt on the last unpin
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-401

    Missing Release of Memory after Effective Lifetime

  • CWE-911

    Improper Update of Reference Count

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM
Severity
Moderate
Public date
Nov 30, 2026, 1:33 PM