HIGH Introduced in 6.1
bpf Trampoline Overflow
CVE-2026-90358
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.7HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: bpf, x86: Fix trampoline stack size for 128-bit arguments btf_distill_func_proto() accepts a function argument up to 16 bytes, so a 128-bit scalar such as __int128 reaches the x86 trampoline with arg_size == 16. But the current implementation assumes an __int128 argument only needs one register, so the register save area is under-allocated and save_args() overwrites adjacent stack slots. Compute the register count from arg_size for all arguments to fix it.
02KernelScan AI Analysis
Risk summary
A local attacker with BPF loading privileges can trigger a stack buffer overflow in the x86 BPF trampoline by attaching a program to a function with 128-bit scalar arguments. The overflow corrupts adjacent kernel stack memory, potentially leading to arbitrary read/write of kernel memory or a kernel crash. Systems that allow unprivileged BPF or grant CAP_BPF to untrusted users are at highest risk.
Vulnerability analysis
When the x86 BPF trampoline prepares to save function arguments for a traced function, it under-counts the number of registers needed for 128-bit scalar arguments such as __int128. The original code only added extra register slots for arguments explicitly flagged as struct arguments, but the BTF type distillation layer accepts any argument up to 16 bytes, including plain 128-bit scalars that also require two registers. As a result, the register save area on the stack is too small, and the argument-saving routine writes past the end of the allocated area into adjacent stack slots. The fix computes the register count from the actual argument size for every argument, ensuring the save area is always large enough. This path is reachable locally by loading a BPF tracing program (fentry/fexit/fmod_ret) that targets a kernel function with __int128 parameters, which requires CAP_BPF or, on configurations where unprivileged BPF is enabled, no special privileges.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.1 | 6.12.110 | 4aed2346fa9b |
| 6.18 | 6.1 | 6.18.52 | 40f3bfbbb222 |
| 7.2 | 6.1 | 7.2.6 | a6d7d7a253c5 |
| mainline | 6.1 | 7.3-rc1 | 814cba835ef6 |
| cip/6.12 | 6.1 | 6.12.111-cip32 | 4aed2346fa9b |