linux/arch
Ilya Leoshkevich a192103a11 s390/bpf: Pass through tail call counter in trampolines
s390x eBPF programs use the following extension to the s390x calling
convention: tail call counter is passed on stack at offset
STK_OFF_TCCNT, which callees otherwise use as scratch space.

Currently trampoline does not respect this and clobbers tail call
counter. This breaks enforcing tail call limits in eBPF programs, which
have trampolines attached to them.

Fix by forwarding a copy of the tail call counter to the original eBPF
program in the trampoline (for fexit), and by restoring it at the end
of the trampoline (for fentry).

Fixes: 528eb2cb87 ("s390/bpf: Implement arch_prepare_bpf_trampoline()")
Reported-by: Leon Hwang <hffilwlqm@gmail.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230906004448.111674-1-iii@linux.ibm.com
2023-09-06 10:48:14 +02:00
..
alpha hardening updates for v6.6-rc1 2023-08-28 12:59:45 -07:00
arc asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
arm arm64 updates for 6.6 2023-08-28 17:34:54 -07:00
arm64 Networking changes for 6.6. 2023-08-29 11:33:01 -07:00
csky arch/csky patches for 6.5 2023-07-01 21:12:32 -07:00
hexagon Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
ia64 ACPI updates for 6.6-rc1 2023-08-28 17:58:39 -07:00
loongarch Perf events changes for v6.6: 2023-08-28 16:35:01 -07:00
m68k m68k updates for v6.6 2023-08-28 17:29:09 -07:00
microblaze arch: Register fchmodat2, usually as syscall 452 2023-07-27 12:25:35 +02:00
mips Perf events changes for v6.6: 2023-08-28 16:35:01 -07:00
nios2 slab updates for 6.5 2023-06-29 16:34:12 -07:00
openrisc OpenRISC fix for 6.5 2023-07-12 16:28:53 -07:00
parisc v6.6-vfs.fchmodat2 2023-08-28 11:25:27 -07:00
powerpc Networking changes for 6.6. 2023-08-29 11:33:01 -07:00
riscv Networking changes for 6.6. 2023-08-29 11:33:01 -07:00
s390 s390/bpf: Pass through tail call counter in trampolines 2023-09-06 10:48:14 +02:00
sh v6.6-vfs.fchmodat2 2023-08-28 11:25:27 -07:00
sparc v6.6-vfs.fchmodat2 2023-08-28 11:25:27 -07:00
um hardening updates for v6.6-rc1 2023-08-28 12:59:45 -07:00
x86 Networking changes for 6.6. 2023-08-29 11:33:01 -07:00
xtensa v6.6-vfs.fchmodat2 2023-08-28 11:25:27 -07:00
.gitignore
Kconfig cpu/SMT: Create topology_smt_thread_allowed() 2023-07-28 09:53:37 +02:00