CVE-2026-139331: bpf, x86: Pass a trampoline's stack arguments by the calling convention

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

bpf, x86: Pass a trampoline's stack arguments by the calling convention

A trampoline on a function of a program that can tail call keeps the tail call counter pointer by pushing rax after allocating its frame. When it calls the original function, for fexit, fmodret or fsession, the push sits between the stack arguments and the return address, which the x86-64 calling convention does not allow. For example, in

run() -> callstack() -> calleestack(a, b, c, d, e, f, g, h) run() -> subprogtail() -> bpftailcall()

calleestack() is not on the path to the tail call, so the verifier allows its stack arguments g and h. fexit on it builds, with T the trampoline's rbp:

T-120 h saveargs() T-128 g saveargs(), RSP after sub rsp, 128 T-136 tailcallcntptr push rax, RSP at the call T-144 return address call origcall

and calleestack() finds the counter pointer where g belongs, at 8(%rsp) on entry, and g where h belongs.

Keep the pointer in a slot of the frame instead, so that the stack arguments sit right above the return address again:

T-120 tailcallcntptr mov [rbp - 120], rax T-128 (pad to 16) T-136 h saveargs() T-144 g saveargs(), RSP at the call T-152 return address call origcall

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Keep the trampoline tail-call counter pointer in a slot of the frame instead of pushing rax, so stack arguments remain above the return address according to the x86-64 calling convention.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:33 PM
Data Sourced
via MITRE·01:33 PM
Description

Frequently Asked Questions

1

What conditions are required for this issue to occur?

The affected path involves an x86 BPF trampoline attached to a function in a program that can perform a tail call. The trampoline must call the original function in an fexit, fmod_ret, or fsession scenario where the original function receives stack-passed arguments.

2

Which function arguments are affected?

Arguments passed on the stack can be displaced because the trampoline pushes the tail-call counter pointer between those arguments and the return address. In the example, the callee reads the counter pointer as argument g and reads g as argument h.

3

Is every tail-call target affected?

No. The described case requires a function that is not on the path to the tail call, allowing the verifier to permit its stack arguments while the trampoline still preserves the tail-call counter.

4

What does the fix change?

The fix stores the tail-call counter pointer in a trampoline frame slot rather than pushing it onto the stack before calling the original function. This restores the x86-64 calling-convention layout, with stack arguments directly above the return address.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203