CVE-2026-139624: bpf, x86: Fix timed may_goto with private stack
In the Linux kernel, the following vulnerability has been resolved:
bpf, x86: Fix timed maygoto with private stack
archbpftimedmaygoto() computes the address of count and timestamp as rbp + offset. When the prog uses private stack the JIT maps r10 to r9 and nothing is reserved under rbp, so bpfchecktimedmaygoto() reads and writes the timestamp in the kernel stack, where archbpftimedmaygoto() has just saved r0-r5 or further down. The following loop in fentry prog with r0-r5 set to zero:
1: maygoto +2 r6 += 1 goto 1b
leaves r3 with ktime in it when the prog has 64 bytes of stack and ends after 65535 iterations when it has 128.
Add the frame pointer to the offset in the JIT, where rbp vs r9 is known, and pass the pointer in AX.
arm64 and powerpc JITs keep the address of private stack in BPFREGFP and are not affected.
Affected Software
Event History
Frequently Asked Questions
Which systems are affected by this issue?
The issue affects the x86 BPF JIT path when a BPF program uses a private stack and uses timed may_goto. arm64 and powerpc JITs are not affected because they retain the private-stack address in BPF_REG_FP.
What conditions are needed to trigger the faulty behavior?
A BPF program must use private stack and execute timed may_goto. The described example is an fentry program with r0 through r5 set to zero and a loop using may_goto.
What happens when the issue is triggered?
The timed may_goto check can read and write a timestamp in kernel stack space that overlaps registers saved by the JIT, rather than the intended private-stack location. In the described loop, r3 can retain a ktime value with a 64-byte stack, while a 128-byte stack causes the program to end after 65,535 iterations.