CVE-2026-139309

bpf: Bound the nesting that the BTF show code follows

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: Bound the nesting that the BTF show code follows

btf_struct_show() and btf_array_show() recurse for every nested struct
and array. MAX_RESOLVE_DEPTH bounds one resolve walk when BTF is loaded,
not the nesting: a member whose type is resolved already is not walked
again, so BTF that defines its types from the inside out can nest them as
deep as it has types.

Whoever may load BTF, with CAP_BPF or a BPF token, can give such a type
to the value of a map. Reading the file of that map in bpffs then
overruns the kernel stack: with a few hundred levels the stack guard page
is hit and the kernel panics.

Stop at 32 levels. That is MAX_RESOLVE_DEPTH, and __btf_show_indent()
has as many columns. Nothing is shown for a member that lies deeper, and
the status becomes -E2BIG, which bpf_snprintf_btf() and
bpf_seq_printf_btf() return. The types of an x86_64 defconfig kernel nest
14 deep.

Analysis

AI-generated

Technical impact

In the Linux kernel, the BPF BTF show functions recurse through every nested struct and array. The original limit governed only the resolve walk depth, not the member nesting depth. An attacker who can load BTF data—either with CAP_BPF or a BPF token—can provide a type that nests deeply. When a user reads the associated map in bpffs, the kernel stack overflows after about a hundred levels, triggering a guard-page hit and a kernel panic. This represents a stack‑based buffer overflow (CWE-119) that causes the denial of service through a kernel crash, rather than code execution.

Affected Systems

All Linux kernel configurations that include the vulnerable bpf BTF show code and lack the mitigated nesting depth limit are affected. The fix, which stops recursion at 32 levels, has not been applied to these releases. Exact version ranges are not specified in the advisory.

Risk and Exploitability

The CVSS score is not listed, and EPSS data is unavailable. The vulnerability is not present in the CISA KEV catalog. Actual exploitation requires the ability to load custom BTF types, which is typically restricted to privileged users or processes granted CAP_BPF. An attacker can craft a deeply nested type, load it into a BPF map, and cause a crash by triggering a read of that map. The attack vector therefore is a local or privileged user who can supply BTF data; it does not provide remote code execution or privilege escalation beyond the causing process. The risk remains high due to kernel instability, but the exploitation likelihood is limited by the available permission model.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the patch limiting BTF nesting to 32 levels.
  • Remove or restrict CAP_BPF from untrusted processes or users to prevent them from loading custom BTF data.
  • Disable or remove unnecessary BPF features and map load capabilities if they are not essential to your environment.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
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: Bound the nesting that the BTF show code follows btf_struct_show() and btf_array_show() recurse for every nested struct and array. MAX_RESOLVE_DEPTH bounds one resolve walk when BTF is loaded, not the nesting: a member whose type is resolved already is not walked again, so BTF that defines its types from the inside out can nest them as deep as it has types. Whoever may load BTF, with CAP_BPF or a BPF token, can give such a type to the value of a map. Reading the file of that map in bpffs then overruns the kernel stack: with a few hundred levels the stack guard page is hit and the kernel panics. Stop at 32 levels. That is MAX_RESOLVE_DEPTH, and __btf_show_indent() has as many columns. Nothing is shown for a member that lies deeper, and the status becomes -E2BIG, which bpf_snprintf_btf() and bpf_seq_printf_btf() return. The types of an x86_64 defconfig kernel nest 14 deep.
Title bpf: Bound the nesting that the BTF show code follows
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

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