CVE-2026-139299

bpf: Free what map_free() unlinks for sleepable readers

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

bpf: Free what map_free() unlinks for sleepable readers

bpf_local_storage_map_free() takes the elements of the map off the lists
of their owners, which are alive, and frees them, and the storage of an
owner with its last element, behind a plain RCU grace period. Nobody uses
the map any more, but the other maps of these owners are in use. A
sleepable program calls the get and delete helpers under
rcu_read_lock_trace() only. While it walks the list of an owner for its
own map, or is about to lock the storage, the element it stands on, or the
storage, can be freed under it.

Whatever else takes an element off the list of a live owner frees it
behind an RCU Tasks Trace grace period, which implies a plain one. Do so
in bpf_local_storage_map_free() as well. It waits for these callbacks
before it frees the map.

This does not help a sleepable program that hands an owner to the helpers
which nobody holds, and which may be gone by then.

Analysis

AI-generated

Technical impact

This vulnerability occurs in the BPF local‑storage map freeing logic of the Linux kernel. When a map element is removed, it can be freed while a sleepable program is still iterating over it under an RCU read lock. The freeing occurs behind a plain RCU grace period, which allows the reader to dereference memory that has already been deallocated. The resulting use‑after‑free can corrupt kernel data structures, giving an attacker the possibility of escalating privileges or crashing the system.

Affected Systems

All Linux kernels that have not yet incorporated the patch in bpf_local_storage_map_free() are affected. The flaw is present in every distribution that ships an unpatched kernel, regardless of architecture, since the CPE identifier covers the generic Linux kernel. Kernel releases that contain the fix are safe.

Risk and Exploitability

Although the public CVSS score is undisclosed, the kernel‑level nature and the lack of mitigations indicate a high‑severity rating. EPSS data is not available and KEV does not list the vulnerability, suggesting low exploitation prevalence at present. An attacker would require local kernel access, typically by loading a malicious BPF program or module, to exploit the use‑after‑free. Successful exploitation could lead to privilege escalation or a kernel panic.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the vendor patch or upgrade to a distribution release that includes the bpf_local_storage_map_free() fix
  • Reboot the host to ensure the patched kernel is running
  • If an immediate kernel upgrade is not feasible, disable BPF local‑storage or disable BPF execution entirely to prevent use of the vulnerable helpers

Generated by OpenCVE AI on December 1, 2026 at 11:17 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-362
CWE-416
Type Values Removed Values Added
Weaknesses CWE-362
CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Free what map_free() unlinks for sleepable readers bpf_local_storage_map_free() takes the elements of the map off the lists of their owners, which are alive, and frees them, and the storage of an owner with its last element, behind a plain RCU grace period. Nobody uses the map any more, but the other maps of these owners are in use. A sleepable program calls the get and delete helpers under rcu_read_lock_trace() only. While it walks the list of an owner for its own map, or is about to lock the storage, the element it stands on, or the storage, can be freed under it. Whatever else takes an element off the list of a live owner frees it behind an RCU Tasks Trace grace period, which implies a plain one. Do so in bpf_local_storage_map_free() as well. It waits for these callbacks before it frees the map. This does not help a sleepable program that hands an owner to the helpers which nobody holds, and which may be gone by then.
Title bpf: Free what map_free() unlinks for sleepable readers
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

No weakness.

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