CVE-2026-139620

bpf: Fix uninit read for non-fetch atomics on partially spilled slots

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 uninit read for non-fetch atomics on partially spilled slots

check_stack_read_fixed_off() skips partial spill checks for non-fetch
atomics; the following prog can be loaded:

0: (b7) r1 = 1 ; R1=1
1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1
2: (db) lock *(u64 *)(r10 -8) += r1 ; R1=1 R10=fp0 fp-8=mmmmmmmm
3: (79) r0 = *(u64 *)(r10 -8) ; R0=scalar() R10=fp0 fp-8=mmmmmmmm
4: (77) r0 >>= 32 ; R0=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
5: (95) exit

When test run:
retval=4294967295

Note fp-8 is ????1 at #1, yet it becomes fp-8=mmmmmmmm after the
non-fetching atomic add at #2; hence the high 32 bits are leaked.

Fix by applying the partial load check; after the patch, the
prog is rejected:

Verification failed: Memory Safety: Uninitialized stack read

Reason:
This rejected read uses 8 bytes at stack offset -8, but byte 4 in that range is uninitialized on
this path. Programs loaded with CAP_PERFMON can be allowed to read uninitialized stack bytes, but
this program is being rejected without that allowance.

At:
...
0 | (b7) r1 = 1
1 | (63) *(u32 *)(r10 -8) = r1
>>> 2 | (db) lock *(u64 *)(r10 -8) += r1
3 | (79) r0 = *(u64 *)(r10 -8)
4 | (77) r0 >>= 32

This affects CAP_BPF only.

Analysis

AI-generated

Technical impact

A bug in the Linux kernel’s BPF verifier allows a program that performs a non‑fetch atomic operation on a partially spilled stack slot to read uninitialized high‑order bits of the stack. The read occurs after the atomic add, after the lower 32 bits have been written, so the high 32 bits are leaked to the BPF program. This leak gives an attacker a short window of kernel memory disclosure, which could be leveraged by a privileged user to exfiltrate sensitive data or to facilitate further exploitation.

Affected Systems

The vulnerability exists in all versions of the Linux kernel that do not include the patch. It affects the kernel itself, particularly the BPF subsystem, and is limited to processes that possess the CAP_BPF privilege. Any kernel running before the fix is potentially vulnerable.

Risk and Exploitability

The flaw requires local privilege to load a BPF program with CAP_BPF (or CAP_PERFMON). An attacker with such capability can trigger the verifier to accept a program that reads uninitialized memory and thus extract stack bytes. The exploitation probability is moderate because it is not remotely exploitable and requires a kernel holding the capability, but once the privilege is present it is straightforward. EPSS score is not available and the issue is not listed in CISA’s KEV catalog, indicating that large‑scale active exploitation has not been observed. The patch is the recommended mitigation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel update that contains the fix (commit 38a9243936ff) or manually apply the patch to the kernel source.
  • Validate that the kernel now rejects BPF programs that perform non‑fetch atomics on partially spilled stack slots by attempting to load a test program that previously succeeded.
  • Restrict CAP_BPF access to trusted users or enforce stricter SELinux/AppArmor profiles so that only privileged processes can load BPF programs.

Generated by OpenCVE AI on November 30, 2026 at 23:59 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-788
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Fix uninit read for non-fetch atomics on partially spilled slots check_stack_read_fixed_off() skips partial spill checks for non-fetch atomics; the following prog can be loaded: 0: (b7) r1 = 1 ; R1=1 1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1 2: (db) lock *(u64 *)(r10 -8) += r1 ; R1=1 R10=fp0 fp-8=mmmmmmmm 3: (79) r0 = *(u64 *)(r10 -8) ; R0=scalar() R10=fp0 fp-8=mmmmmmmm 4: (77) r0 >>= 32 ; R0=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff)) 5: (95) exit When test run: retval=4294967295 Note fp-8 is ????1 at #1, yet it becomes fp-8=mmmmmmmm after the non-fetching atomic add at #2; hence the high 32 bits are leaked. Fix by applying the partial load check; after the patch, the prog is rejected: Verification failed: Memory Safety: Uninitialized stack read Reason: This rejected read uses 8 bytes at stack offset -8, but byte 4 in that range is uninitialized on this path. Programs loaded with CAP_PERFMON can be allowed to read uninitialized stack bytes, but this program is being rejected without that allowance. At: ... 0 | (b7) r1 = 1 1 | (63) *(u32 *)(r10 -8) = r1 >>> 2 | (db) lock *(u64 *)(r10 -8) += r1 3 | (79) r0 = *(u64 *)(r10 -8) 4 | (77) r0 >>= 32 This affects CAP_BPF only.
Title bpf: Fix uninit read for non-fetch atomics on partially spilled slots
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-788

    Access of Memory Location After End of Buffer

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:36 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM