CVE-2026-139286

bpf: Zero-extend the index in inlined bpf_get_func_arg()

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: Zero-extend the index in inlined bpf_get_func_arg()

bpf_get_func_arg() takes a u32 index, but the inlined expansion compared
only the low 32 bits of R2 with the argument count and then shifted the
full 64-bit register to compute the context address. R2 is ARG_ANYTHING,
so nothing guarantees that its upper bits are zero: an index of
1ULL << 32 passes the bounds check as index zero while the load is
performed at ctx + (1ULL << 35).

Shift the index as a 32-bit value. When the 32-bit bounds check passes,
the low 32 bits of R2 are below R0, and R0 is at most 255: the trampoline
arm masks the argument count with 0xFF and the raw_tp arm uses the BTF
argument count minus one, which the verifier caps at MAX_BPF_FUNC_ARGS.
The 3-bit shift therefore cannot overflow and it clears the upper bits of
the register. Widening the comparison instead would reject indices whose
low 32 bits are valid. The check itself is unchanged, so this cannot
change which programs are accepted, only the address that is computed.

Analysis

AI-generated

Technical impact

An unzero-extended index in the Linux kernel’s bpf_get_func_arg() function allows a BPF program to supply a 64‑bit value whose high 32 bits are non‑zero. The bounds check compares only the low 32 bits, so an index such as 1ULL<<32 passes the check as zero, yet the load uses the full 64‑bit value when computing a context address. This results in an out‑of‑bounds memory access that can corrupt kernel memory, potentially granting elevated privileges or causing a denial of service.

Affected Systems

Any Linux kernel release that contains the pre‑patch implementation of bpf_get_func_arg(), as identified by the vendor entry Linux:Linux. The vulnerability is present in all kernel versions before the patch referenced in the provided commit URLs.

Risk and Exploitability

The bug represents an out‑of‑bounds read/write in kernel space, which is normally considered high risk. The EPSS score is not available and the vulnerability is not listed in CISA KEV, so its exploitation probability is unknown. A local user with the ability to load eBPF programs can trigger the fault, making the attack vector local and dependent on CAP_BPF. The lack of a publicly known exploit and the absence of a specific CVSS score suggest a moderate to high risk, contingent on the attacker’s access to BPF program loading.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the patch correcting the bpf_get_func_arg() zero‑extension logic.
  • Recompile any eBPF programs that rely on bpf_get_func_arg() so they execute against the updated kernel.
  • If a kernel upgrade is not immediately possible, restrict or revoke the CAP_BPF capability from untrusted processes or enforce mandatory access controls such that only trusted users may load BPF programs.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-129
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Zero-extend the index in inlined bpf_get_func_arg() bpf_get_func_arg() takes a u32 index, but the inlined expansion compared only the low 32 bits of R2 with the argument count and then shifted the full 64-bit register to compute the context address. R2 is ARG_ANYTHING, so nothing guarantees that its upper bits are zero: an index of 1ULL << 32 passes the bounds check as index zero while the load is performed at ctx + (1ULL << 35). Shift the index as a 32-bit value. When the 32-bit bounds check passes, the low 32 bits of R2 are below R0, and R0 is at most 255: the trampoline arm masks the argument count with 0xFF and the raw_tp arm uses the BTF argument count minus one, which the verifier caps at MAX_BPF_FUNC_ARGS. The 3-bit shift therefore cannot overflow and it clears the upper bits of the register. Widening the comparison instead would reject indices whose low 32 bits are valid. The check itself is unchanged, so this cannot change which programs are accepted, only the address that is computed.
Title bpf: Zero-extend the index in inlined bpf_get_func_arg()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-129

    Improper Validation of Array Index

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