linux/arch/s390
Ilya Leoshkevich e1d6661095 s390/bpf: Write back tail call counter for BPF_TRAMP_F_CALL_ORIG
commit bc3905a71f upstream.

The tailcall_bpf2bpf_hierarchy_fentry test hangs on s390. Its call
graph is as follows:

  entry()
    subprog_tail()
      trampoline()
        fentry()
        the rest of subprog_tail()  # via BPF_TRAMP_F_CALL_ORIG
        return to entry()

The problem is that the rest of subprog_tail() increments the tail call
counter, but the trampoline discards the incremented value. This
results in an astronomically large number of tail calls.

Fix by making the trampoline write the incremented tail call counter
back.

Fixes: 528eb2cb87 ("s390/bpf: Implement arch_prepare_bpf_trampoline()")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20250813121016.163375-4-iii@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-10-19 16:34:05 +02:00
..
appldata sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
boot s390/mm: Do not map lowcore with identity mapping 2025-08-28 16:31:15 +02:00
configs s390: Update defconfigs 2024-10-16 11:32:32 +02:00
crypto crypto: s390/sha - Fix uninitialized variable in SHA-1 and SHA-2 2025-07-17 18:37:01 +02:00
hypfs s390/hypfs: Enable limited access during lockdown 2025-08-28 16:31:16 +02:00
include s390/time: Use monotonic clock in get_cycles() 2025-08-20 18:30:29 +02:00
kernel s390/vmlinux.lds.S: Move .vmlinux.info to end of allocatable sections 2025-10-19 16:33:43 +02:00
kvm KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY 2025-06-27 11:11:23 +01:00
lib s390/alternatives: Rework to allow for callbacks 2024-07-23 16:02:31 +02:00
mm mm/ptdump: take the memory hotplug lock inside ptdump_walk_pgd() 2025-08-20 18:30:55 +02:00
net s390/bpf: Write back tail call counter for BPF_TRAMP_F_CALL_ORIG 2025-10-19 16:34:05 +02:00
pci s390/pci: Do not try re-enabling load/store if device is disabled 2025-07-10 16:04:41 +02:00
purgatory s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS 2025-02-08 09:58:19 +01:00
tools s390 updates for 6.12 merge window 2024-09-21 09:02:54 -07:00
Kbuild - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig s390/sclp: Initialize sclp subsystem via arch_cpu_finalize_init() 2025-02-08 09:58:07 +01:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile s390: Add -Wno-pointer-sign to KBUILD_CFLAGS_DECOMPRESSOR 2025-10-19 16:33:57 +02:00
Makefile.postlink s390/build: Avoid relocation information in final vmlinux 2024-08-27 20:16:48 +02:00