linux/arch
Tejun Heo 596824de8c bpf, x86: Fix stack-passed arguments for indirect trampolines
save_args() reads stack-passed arguments relative to rbp assuming two
return addresses sit between the saved rbp and the arguments, which
holds when the trampoline is entered through the fentry call from a
traced function. An indirect trampoline is called through a function
pointer, so only the caller's return address is on the stack and the
arguments start at rbp + 16, not rbp + 24. Every stack-passed argument
of a struct_ops callback with more than six argument slots is read one
slot off.

This has gone unnoticed because no in-tree struct_ops member passes
arguments on the stack. The jmp-entry form already accounts for having
a single return address; treat BPF_TRAMP_F_INDIRECT the same way.

Fixes: 473e3150e3 ("bpf, x86: allow function arguments up to 12 for TRACING")
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Tested-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://patch.msgid.link/20260808003938.3486067-12-memxor@gmail.com
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
2026-08-08 03:03:26 -07:00
..
alpha pci-v7.2-changes 2026-06-24 12:48:43 -07:00
arc ARC: configs: Drop redundant I2C_DESIGNWARE_PLATFORM 2026-07-10 15:26:11 -07:00
arm nuvoton: First batch of ARM arch fixes for 7.2 2026-08-04 21:25:25 +02:00
arm64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.2-rc7 2026-08-07 23:04:17 +02:00
csky ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
hexagon uaccess: unify inline vs outline copy_{from,to}_user() selection 2026-05-28 21:24:44 -07:00
loongarch LoongArch: BPF: Fix memory leak in bpf_jit_free() 2026-07-24 16:33:08 +08:00
m68k m68knommu: fix on top off v7.2-rc4 2026-07-26 08:59:55 -07:00
microblaze microblaze: restore the page alignment of swapper_pg_dir 2026-08-04 20:02:00 -07:00
mips collected fixes for 7.2 2026-07-04 06:05:28 -10:00
nios2 uaccess: unify inline vs outline copy_{from,to}_user() selection 2026-05-28 21:24:44 -07:00
openrisc mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
parisc Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
powerpc powerpc/serial: Fix include guard comment 2026-07-28 10:23:32 +05:30
riscv Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.2-rc7 2026-08-07 23:04:17 +02:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.2-rc7 2026-08-07 23:04:17 +02:00
sh Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
sparc Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
um um: vector: fix use-after-free in vector_mmsg_rx() 2026-07-23 21:31:14 +02:00
x86 bpf, x86: Fix stack-passed arguments for indirect trampolines 2026-08-08 03:03:26 -07:00
xtensa mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
.gitignore
Kconfig Locking updates for v7.2: 2026-06-15 14:21:14 +05:30