CVE-2026-139311

bpf: Link the first element after its storage is published

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: Link the first element after its storage is published

bpf_local_storage_alloc() links the first element of a new storage to the
bucket of its map, and then publishes the storage in the owner with
cmpxchg(). If another cpu has been faster, the element is taken out of
the bucket again and is freed together with the storage.

In between the iterator over a sk_storage map can find the element. It
stays linked to a storage that points to the socket, but the socket knows
nothing of that storage: bpf_sk_storage_free() neither unlinks the element
nor waits for anybody who uses the storage. So nothing tells the iterator
that the socket has gone away.

Three cpus that create the first storage of a new AF_UNIX socket at the
same time, and a fourth that reads the iterator, are enough: in 20 seconds
its program was shown some 4000 elements of storages that had lost. If the
socket is closed in time, the program is handed a freed socket.

Link the element once the storage is published. Both happens under the
lock of the bucket, which holds off whoever finds the element through the
owner and wants to unlink it.

Analysis

AI-generated

Technical impact

The Linux kernel bug occurs while allocating local storage for BPF programs; an element is linked before the storage is fully published, so another CPU can unlink and free the storage while an iterator may still read it, leading to a use‑after‑free condition that can crash the kernel or corrupt data.

Affected Systems

The vulnerability affects the Linux kernel itself, with no specific version information provided. Any kernel that contains the former implementation of bpf_local_storage_alloc and the associated iterator logic is potentially impacted. It is recommended to check the kernel release notes or the two commit hashes mentioned in the advisory for the exact affected kernel versions.

Risk and Exploitability

The exploit requires local access and the ability to load BPF programs that allocate AF_UNIX sockets and traverse sk_storage maps. Although the atomicity of the fix suggests that exploitation may need precise CPU scheduling, the crash or memory corruption presents a high impact for a compromised host. The EPSS score is not available and the issue is not listed in the CISA KEV catalog, but the absence of a mitigation patch makes this vulnerability a high‑risk internal threat for affected systems.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the kernel update that includes the fix from the commits referenced in the advisory; this publishes the storage before linking the element.
  • If a kernel upgrade cannot be performed immediately, consider disabling BPF local storage or preventing BPF programs that use AF_UNIX sockets from running until the patch is applied.
  • Continuously monitor kernel logs for audit events or crashes that may indicate a use‑after‑free; enable BPF debugging as needed for detection.

Generated by OpenCVE AI on November 30, 2026 at 21:46 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: Link the first element after its storage is published bpf_local_storage_alloc() links the first element of a new storage to the bucket of its map, and then publishes the storage in the owner with cmpxchg(). If another cpu has been faster, the element is taken out of the bucket again and is freed together with the storage. In between the iterator over a sk_storage map can find the element. It stays linked to a storage that points to the socket, but the socket knows nothing of that storage: bpf_sk_storage_free() neither unlinks the element nor waits for anybody who uses the storage. So nothing tells the iterator that the socket has gone away. Three cpus that create the first storage of a new AF_UNIX socket at the same time, and a fourth that reads the iterator, are enough: in 20 seconds its program was shown some 4000 elements of storages that had lost. If the socket is closed in time, the program is handed a freed socket. Link the element once the storage is published. Both happens under the lock of the bucket, which holds off whoever finds the element through the owner and wants to unlink it.
Title bpf: Link the first element after its storage is published
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