CVE-2026-139609

bpf: Avoid quadratic successor rescan in bpf_compute_scc

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: Avoid quadratic successor rescan in bpf_compute_scc

The iterative Tarjan DFS in bpf_compute_scc() emulates recursion with an
explicit 'dfs' stack: when a successor has not been visited yet, the
successor is pushed and the walk restarts at the top of the loop. On the
way back to a vertex the successor scan starts over at index zero, so a
vertex with k successors rescans up to k successors on each of its up to k
descents, i.e. O(k^2) work.

For ordinary instructions k <= 2 and this is irrelevant. For a gotox the
successors are the jump table of the containing subprogram, whose size is
bounded only by the max_entries of the insn_array map, so k can reach the
1M instruction complexity limit. Loading such a program keeps a CPU busy
in the loop for a very long time before verification even begins.

Record in 'dfs_pos' the successor index each frame stopped at and resume
the scan there. Each edge is therefore examined a bounded number of times
and the walk becomes linear in the number of edges.

Analysis

AI-generated

Technical impact

The vulnerability arises in the Linux kernel’s eBPF verifier when processing a subprogram containing a ‘gotox’ instruction. The Tarjan depth‑first search used to compute strongly‑connected components rescans a vertex’s successors from the start every time it backtracks, leading to quadratic work for a vertex with many successors. If the jump table is large, the number of successors can approach the BPF instruction limit of 1 million, causing the kernel to spend an excessive amount of time in this loop before any program verification occurs. The impact is overwhelming CPU consumption that can effectively lock a host, preventing normal operation of the kernel and other processes. The weakness is an uncontrolled resource consumption flaw.

Affected Systems

Distributions that ship the Linux kernel and allow loading of eBPF programs are affected. Any system running a kernel compiled with the vulnerable bpf_compute_scc implementation and capable of loading BPF programs that contain a ‘gotox’ instruction is at risk. Vendor: Linux kernel; product: Linux kernel; no specific version information is supplied, so the fix applies to all kernels after the patch commit that applies the linear‑scan change.

Risk and Exploitability

The attacker must be able to load a crafted eBPF program, which typically requires privilege (e.g., root or CAP_NET_ADMIN). The vulnerability is therefore exploitable locally. Because no EPSS score is provided, the probability of exploitation is unknown, but the condition is straightforward and the effect is high. The problem is not listed in the CISA KEV catalog, but its high CPU impact suggests a potentially disruptive denial of service once an attacker can execute the attack vector. No public exploit is known, but the attack path is clear and could be automated by tools that generate large BPF programs.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel update that contains the bpf_compute_scc fix
  • Restrict the size of BPF jump tables by configuring a lower max_entries for the insn_array map before loading programs
  • Run untrusted BPF programs in a controlled environment or use cgroups to limit CPU usage

Generated by OpenCVE AI on December 1, 2026 at 00:04 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-400
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Avoid quadratic successor rescan in bpf_compute_scc The iterative Tarjan DFS in bpf_compute_scc() emulates recursion with an explicit 'dfs' stack: when a successor has not been visited yet, the successor is pushed and the walk restarts at the top of the loop. On the way back to a vertex the successor scan starts over at index zero, so a vertex with k successors rescans up to k successors on each of its up to k descents, i.e. O(k^2) work. For ordinary instructions k <= 2 and this is irrelevant. For a gotox the successors are the jump table of the containing subprogram, whose size is bounded only by the max_entries of the insn_array map, so k can reach the 1M instruction complexity limit. Loading such a program keeps a CPU busy in the loop for a very long time before verification even begins. Record in 'dfs_pos' the successor index each frame stopped at and resume the scan there. Each edge is therefore examined a bounded number of times and the walk becomes linear in the number of edges.
Title bpf: Avoid quadratic successor rescan in bpf_compute_scc
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

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