CVE-2026-139296

bpf: Keep values of a dead owner for sleepable programs

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: Keep values of a dead owner for sleepable programs

bpf_local_storage_destroy() frees the elements of an owner behind a plain
RCU grace period, on the ground that no program can refer to an owner that
goes away. But the pointer that bpf_task_storage_get() and its like
return stays valid for the verifier after the program has released the
owner, or has left the bpf_rcu_read_lock() section it had the owner from.
A sleepable program is in no RCU read side critical section, so it can
write to the value after the owner has died and the element was freed:

BUG: KASAN: slab-use-after-free in _copy_from_user+0x42/0xa0
Write of size 8 at addr ffff8880074404a8 by task lsuaf/55

Free the element behind an RCU Tasks Trace grace period if sleepable code
may use the map. A program that a map is bound to was loaded, and counted
in map->sleepable_refcnt, before it got a value from the live owner, and
stays counted until a grace period behind its last run.

A program can also get at a storage map by a lookup in an outer map. Then
only the outer map is counted, its programs can come after the inner map
was put into it, and can hold on to the inner map after it was taken out.
So note in a map that it has been an inner map, and treat it like one with
sleepable users from then on.

The same goes for what the special fields of the value hold. The page of
a uptr has to stay pinned, and a kptr which the program stores after the
owner has died has to be released. Leave the fields, and the smap that it
takes to free them, to bpf_selem_free_trace_rcu(), as bpf_selem_unlink()
does. bpf_local_storage_map_free() waits for that callback, and leaves
smap alone if it comes across such an element.

Elements of such maps now wait for sleepable programs that are running
when their owner dies. Other maps are freed as before.

Analysis

AI-generated

Technical impact

A use‑after‑free flaw exists in the Linux kernel BPF local storage subsystem. When a storage map owner is freed while a sleepable BPF program still holds a reference, the memory is reclaimed but a valid pointer remains exposed to the verifier. The running program can then write to this stale memory, causing a kernel memory corruption that can be leveraged to execute arbitrary code within the kernel context. The weakness is a classic use‑after‑free violation, allowing an attacker privileged enough to load BPF programs to induce the fault and gain kernel privileges.

Affected Systems

The issue affects Linux kernel implementations that include the bpf local storage and RCU handling in the core. All kernel releases prior to the patch committing the bug fix are potentially vulnerable. Without explicit versioning in the advisory, any system running a kernel that incorporates the BPF local storage feature and has the buggy RCU logic is impacted.

Risk and Exploitability

The CVSS score is not provided, and EPSS information is missing, so the exact quantifiable risk is unclear. The exploit path requires an attacker to load a tailored BPF program that accesses a storage map after its owner has been freed. As the flaw opens a kernel memory corruption, it can be abused for privilege escalation or remote code execution if the attacker can influence the program’s context. The vulnerability is not listed in the CISA KEV catalog, indicating limited or no active exploitation, but the potential impact remains high. The likely attack vector is local or remote depending on the availability of BPF interfaces to the user, and the required conditions are that the victim kernel hosts sleepable BPF programs referencing the local storage map.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel update that incorporates the RCU‑safe storage map cleanup logic from the vendor patch
  • If an update cannot be applied immediately, disable or restrict BPF local storage usage by setting appropriate kernel parameters or removing the BPF program loading capability for untrusted users
  • Implement policy controls to ensure BPF programs run only in non‑sleepable contexts, limiting the window in which a storage map owner can be freed while a program is active

Generated by OpenCVE AI on November 30, 2026 at 21:04 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Keep values of a dead owner for sleepable programs bpf_local_storage_destroy() frees the elements of an owner behind a plain RCU grace period, on the ground that no program can refer to an owner that goes away. But the pointer that bpf_task_storage_get() and its like return stays valid for the verifier after the program has released the owner, or has left the bpf_rcu_read_lock() section it had the owner from. A sleepable program is in no RCU read side critical section, so it can write to the value after the owner has died and the element was freed: BUG: KASAN: slab-use-after-free in _copy_from_user+0x42/0xa0 Write of size 8 at addr ffff8880074404a8 by task lsuaf/55 Free the element behind an RCU Tasks Trace grace period if sleepable code may use the map. A program that a map is bound to was loaded, and counted in map->sleepable_refcnt, before it got a value from the live owner, and stays counted until a grace period behind its last run. A program can also get at a storage map by a lookup in an outer map. Then only the outer map is counted, its programs can come after the inner map was put into it, and can hold on to the inner map after it was taken out. So note in a map that it has been an inner map, and treat it like one with sleepable users from then on. The same goes for what the special fields of the value hold. The page of a uptr has to stay pinned, and a kptr which the program stores after the owner has died has to be released. Leave the fields, and the smap that it takes to free them, to bpf_selem_free_trace_rcu(), as bpf_selem_unlink() does. bpf_local_storage_map_free() waits for that callback, and leaves smap alone if it comes across such an element. Elements of such maps now wait for sleepable programs that are running when their owner dies. Other maps are freed as before.
Title bpf: Keep values of a dead owner for sleepable programs
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

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