CVE-2026-139312

bpf: Fix NULL deref in the sk_storage map iterator

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: Fix NULL deref in the sk_storage map iterator

bpf_sk_storage_map_seq_find_next() hands out an element only if its
local_storage pointer is set. __bpf_sk_storage_map_seq_show() then reads
the pointer a second time and dereferences it without a test.

Since bpf_local_storage_destroy() unlinks the elements with
bpf_selem_unlink_nofail(), the pointer is reset to NULL when the socket
which owns the element is destroyed, so it can change between the two
reads. Reading the iterator while sockets with an element in the map are
closed ends in a NULL pointer dereference. The sockets need not belong to
the reader: where a program gives every new socket an element, an
unprivileged user who opens and closes sockets is enough.

Skip such an element, as the TCP and UDP iterators skip a socket which
has been unhashed.

Analysis

AI-generated

Technical impact

The vulnerability arises when BPF reads the local_storage pointer twice without checking after a socket closure. This race can cause a NULL dereference, resulting in a kernel crash and denial of service. An attacker can trigger it by opening and closing sockets while another process iterates the map. The weakness is a classic NULL pointer dereference consistent with CWE‑476.

Affected Systems

The flaw exists in the Linux kernel's BPF implementation, specifically the sk_storage map iterator. Every kernel that contains this code before the patch commit will be affected. No specific version range is indicated, so any kernel build that has not applied the commit 6186c9711ac6fb984f6c2093c52bf4e827cc50b1 is potentially vulnerable.

Risk and Exploitability

Because the EPSS score is not reported and the vulnerability is not in the CISA KEV catalog, the likelihood of exploitation in the wild appears limited, but it is theoretically available to any user who can execute BPF programs and manipulate sockets. The CVSS score is not provided, so the risk is uncertain; however, a null pointer dereference in the kernel typically carries a high severity. Administrators should treat it as a critical local vulnerability and apply the patch promptly.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes commit 6186c9711ac6fb984f6c2093c52bf4e827cc50b1.
  • Restrict unprivileged BPF program loading by configuring kernel interfaces to allow only root users to attach BPF programs to sockets.
  • Monitor system logs for unexpected kernel crashes or segfaults that may indicate exploitation attempts and verify that BPF instrumentation is not leaking references to closed sockets.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-476
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Fix NULL deref in the sk_storage map iterator bpf_sk_storage_map_seq_find_next() hands out an element only if its local_storage pointer is set. __bpf_sk_storage_map_seq_show() then reads the pointer a second time and dereferences it without a test. Since bpf_local_storage_destroy() unlinks the elements with bpf_selem_unlink_nofail(), the pointer is reset to NULL when the socket which owns the element is destroyed, so it can change between the two reads. Reading the iterator while sockets with an element in the map are closed ends in a NULL pointer dereference. The sockets need not belong to the reader: where a program gives every new socket an element, an unprivileged user who opens and closes sockets is enough. Skip such an element, as the TCP and UDP iterators skip a socket which has been unhashed.
Title bpf: Fix NULL deref in the sk_storage map iterator
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