CVE-2026-139163

bpf: Keep stack arguments in arch_bpf_timed_may_goto()

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: Keep stack arguments in arch_bpf_timed_may_goto()

The JITs pass the first stack arguments of a call in registers:

x86-64 r9 argument 6
arm64 x5-x7 arguments 6-8
riscv64 a5-a7 arguments 6-8

'*(u64 *)(r11 - 8) = rX' writes such a register in the caller.
'rX = *(u64 *)(r11 + 8)' reads it in the callee. A call changes these
registers. Thus the verifier accepts no call between the write and the call
of the callee, and no call in the callee before the read.

may_goto is not a call for the verifier. But one time in 65535 iterations
it calls arch_bpf_timed_may_goto(), and this function calls C code. It
saves R0-R5 only.

*(u64 *)(r11 - 8) = 0 ; the verifier: argument 6 is 0
call sub
sub:
1: may_goto 2f ; C code changes r9
goto 1b
2: r2 = *(u64 *)(r11 + 8) ; r2 is a kernel address
r1 = map_value
r1 += r2
*(u64 *)(r1 + 0) = 0

On x86-64 the C code changes r9 when the time of may_goto is up. With the
hpet clocksource a look at the clock changes r9 too. The prog above crashes
the kernel. LLVM does not emit such code: it reads stack arguments at the
entry of a function, and it writes them immediately before the call.

Save and restore these registers too. The cost is 2 insns on x86-64, 4 on
arm64 and 6 on riscv64, one time in 65535 iterations.

Analysis

AI-generated

Technical impact

The Linux kernel BPF JIT verifier mishandles stack arguments passed in registers when a helper calls C code, causing caller‑saved registers to be corrupted. This leads to a kernel crash when the verifier later reads the corrupted stack location. The weakness is a failure to preserve processor state across calls, corresponding to CWE-682.

Affected Systems

The CVE lists Linux as the affected vendor. Based on the description, it is inferred that all Linux kernel builds that include the BPF JIT and verifier logic without the patch are vulnerable. Because no specific distribution or version range is listed, administrators should examine kernel release notes for updates that address BPF verifier changes.

Risk and Exploitability

EPSS is not available and the flaw is not listed in the CISA KEV catalog. Based on the description, it is inferred that the vulnerability can be exploited by loading a crafted BPF program that loops up to 65535 iterations to trigger arch_bpf_timed_may_goto. No elevation of privileges is required; local users who can load BPF programs can cause a kernel crash. The likely attack vector is local execution of a BPF program. Because the crash can be achieved with simple program logic, the risk to availability is high.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply any available kernel patch that fixes the BPF JIT register‑saver bug
  • Upgrade to a kernel release where the verifier preserves caller‑saved registers before making C calls
  • Restrict or block BPF programs that use loops up to 65535 iterations and that invoke arch_bpf_timed_may_goto, preventing passing arguments in registers that may be clobbered

Generated by OpenCVE AI on December 1, 2026 at 10:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-682
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Keep stack arguments in arch_bpf_timed_may_goto() The JITs pass the first stack arguments of a call in registers: x86-64 r9 argument 6 arm64 x5-x7 arguments 6-8 riscv64 a5-a7 arguments 6-8 '*(u64 *)(r11 - 8) = rX' writes such a register in the caller. 'rX = *(u64 *)(r11 + 8)' reads it in the callee. A call changes these registers. Thus the verifier accepts no call between the write and the call of the callee, and no call in the callee before the read. may_goto is not a call for the verifier. But one time in 65535 iterations it calls arch_bpf_timed_may_goto(), and this function calls C code. It saves R0-R5 only. *(u64 *)(r11 - 8) = 0 ; the verifier: argument 6 is 0 call sub sub: 1: may_goto 2f ; C code changes r9 goto 1b 2: r2 = *(u64 *)(r11 + 8) ; r2 is a kernel address r1 = map_value r1 += r2 *(u64 *)(r1 + 0) = 0 On x86-64 the C code changes r9 when the time of may_goto is up. With the hpet clocksource a look at the clock changes r9 too. The prog above crashes the kernel. LLVM does not emit such code: it reads stack arguments at the entry of a function, and it writes them immediately before the call. Save and restore these registers too. The cost is 2 insns on x86-64, 4 on arm64 and 6 on riscv64, one time in 65535 iterations.
Title bpf: Keep stack arguments in arch_bpf_timed_may_goto()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

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