CVE-2026-139298

bpf: Don't take a program with a target program for an iterator

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

bpf: Don't take a program with a target program for an iterator

bpf_iter_prog_supported() goes by the name of the attach function. Commit
7cc639dc45c5 ("bpf: Don't take an extension for an iterator program")
keeps out extensions, for which that is the name of a function of another
program. A tracing program with BPF_TRACE_ITER that is loaded with
attach_prog_fd gets there as well: unlike for BPF_TRACE_RAW_TP,
bpf_check_attach_target() does not mind the target program.

If the function is called like that of an iterator target, bpf_iter_bpf_map
for example, its id in the BTF of the program is cached as the id of the
target, even if the load fails later. Programs of that target which are
loaded already cannot be attached any more. And the program itself can be
attached as an iterator of that target, with a context that the verifier
has taken from the prototype of that function:

BUG: KASAN: stack-out-of-bounds in bpf_prog_66d4234e2e50f5b6_ts26_forged+0x12a/0x20b
Read of size 8 at addr ffffc90000d9fc48 by task ts26/104

Refuse every program that has a target program. That covers extensions.

Analysis

AI-generated

Technical impact

In the Linux kernel, the BPF iterator program attachment logic was found to incorrectly accept a program that specifies a target program, causing the verifier to bind the wrong prototype. This mis‑caching can lead to a stack out‑of‑bounds read, as shown by the KASAN output, and results in a kernel crash. The vulnerability therefore causes memory corruption and a denial of service on the host. It is a kernel‑level flaw that can crash any process running in the affected kernel.

Affected Systems

All Linux kernel configurations that ship the unpatched bpf subsystem are potentially impacted, including mainstream distributions that use the default Linux kernel. The advisory does not list specific affected release versions, but the flaw exists before the patch commit 7cc639dc45c5, so any kernel built before that point is at risk. System administrators should check their current kernel version against the kernel release notes for the commit that implements the fix.

Risk and Exploitability

Attackers would need to supply a crafted BPF program that calls a function with an iterator target. The CVE text does not state a privilege requirement, so it is inferred that the vulnerability can be triggered by a user who has permission to load BPF programs, which may be privileged or unprivileged depending on the system configuration. The absence of EPSS and lack of KEV listing suggest the exploit has not been publicly observed, but the severity of a kernel crash indicates high risk. Because this is a local bug, the threat timeline is limited to systems where the attacker can load BPF code; if BPF program loading is restricted, the risk is mitigated.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the kernel to a version that contains the commit fixing the BPF iterator attachment validation bug.
  • If a kernel upgrade cannot be applied immediately, disable or restrict the loading of BPF iterator programs by configuring the appropriate sysctl parameters (for example, setting the sysctl that controls BPF_TRACE_ITER usage or limiting /dev/bpf permissions to trusted users).
  • Continuously monitor kernel logs for KASAN or stack-out-of-bounds messages and apply subsequent patches once available.

Generated by OpenCVE AI on December 1, 2026 at 07:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-125
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-119
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Don't take a program with a target program for an iterator bpf_iter_prog_supported() goes by the name of the attach function. Commit 7cc639dc45c5 ("bpf: Don't take an extension for an iterator program") keeps out extensions, for which that is the name of a function of another program. A tracing program with BPF_TRACE_ITER that is loaded with attach_prog_fd gets there as well: unlike for BPF_TRACE_RAW_TP, bpf_check_attach_target() does not mind the target program. If the function is called like that of an iterator target, bpf_iter_bpf_map for example, its id in the BTF of the program is cached as the id of the target, even if the load fails later. Programs of that target which are loaded already cannot be attached any more. And the program itself can be attached as an iterator of that target, with a context that the verifier has taken from the prototype of that function: BUG: KASAN: stack-out-of-bounds in bpf_prog_66d4234e2e50f5b6_ts26_forged+0x12a/0x20b Read of size 8 at addr ffffc90000d9fc48 by task ts26/104 Refuse every program that has a target program. That covers extensions.
Title bpf: Don't take a program with a target program for an iterator
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-119

    Improper Restriction of Operations within the Bounds of a Memory Buffer

  • CWE-125

    Out-of-bounds Read

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
Severity
Moderate
Public date
Nov 30, 2026, 1:33 PM