CVE-2026-139331

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

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, 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, fmod_ret 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() -> call_stack() -> callee_stack(a, b, c, d, e, f, g, h)
run() -> subprog_tail() -> bpf_tail_call()

callee_stack() 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 save_args()
T-128 g save_args(), RSP after sub rsp, 128
T-136 tail_call_cnt_ptr push rax, RSP at the call
T-144 return address call orig_call

and callee_stack() 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 tail_call_cnt_ptr mov [rbp - 120], rax
T-128 (pad to 16)
T-136 h save_args()
T-144 g save_args(), RSP at the call
T-152 return address call orig_call

Analysis

AI-generated

Technical impact

A trampoline used for BPF tail calls on x86 systems incorrectly places a pushed register between stack arguments and the return address, violating the calling convention. This misalignment causes the callee to interpret arguments incorrectly, potentially leading to memory corruption or unintended kernel behavior. The result can be a kernel panic or service disruption, which in turn may become a vector for privilege escalation if an attacker can exploit the corrupted state.

Affected Systems

The vulnerability affects the Linux kernel on x86_64 architectures. No specific version ranges were provided in the CNA data, so any kernel revision prior to the commits referenced (189c4356a409de... and 9f9c30435ca92cddb37e67cda46ec02e26dd0a07) is potentially affected.

Risk and Exploitability

The CVSS score for this issue is not publicly available, and EPSS information is not provided. It is also not listed in the CISA KEV catalog. An attacker would need to supply a BPF program that performs a tail call, which typically requires privileged access (CAP_SYS_ADMIN). Therefore, the risk is localized to systems that allow untrusted BPF loading or use untrusted BPF code paths. The vulnerability could be exploited on the local machine, but it does not appear to be remotely exploitable through network interfaces.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel update that incorporates the commits 189c4356a409de684686266924e841ec2f93992c and 9f9c30435ca92cddb37e67cda46ec02e26dd0a07.
  • Modify existing BPF programs to avoid using tail calls that rely on the old trampoline behavior, or replace them with direct function calls where appropriate.
  • Enable kernel logging for panics or stack-related errors and verify system stability after updating.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-121
Type Values Removed Values Added
Description 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, fmod_ret 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() -> call_stack() -> callee_stack(a, b, c, d, e, f, g, h) run() -> subprog_tail() -> bpf_tail_call() callee_stack() 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 save_args() T-128 g save_args(), RSP after sub rsp, 128 T-136 tail_call_cnt_ptr push rax, RSP at the call T-144 return address call orig_call and callee_stack() 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 tail_call_cnt_ptr mov [rbp - 120], rax T-128 (pad to 16) T-136 h save_args() T-144 g save_args(), RSP at the call T-152 return address call orig_call
Title bpf, x86: Pass a trampoline's stack arguments by the calling convention
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-121

    Stack-based Buffer Overflow

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