]> Gentwo Git Trees - linux/.git/commit
s390/bpf: Write back tail call counter for BPF_PSEUDO_CALL
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 13 Aug 2025 12:06:29 +0000 (14:06 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 18 Aug 2025 13:08:29 +0000 (15:08 +0200)
commitc861a6b147137d10b5ff88a2c492ba376cd1b8b0
tree78342d4fabad90517bf1050f9ef8cd6db73b4153
parenteada40e057fc1842358d9daca3abe5cacb21e8a1
s390/bpf: Write back tail call counter for BPF_PSEUDO_CALL

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

  entry()
    subprog_tail()
      bpf_tail_call_static(0) -> entry + tail_call_start
    subprog_tail()
      bpf_tail_call_static(0) -> entry + tail_call_start

entry() copies its tail call counter to the subprog_tail()'s frame,
which then increments it. However, the incremented result is discarded,
leading to an astronomically large number of tail calls.

Fix by writing the incremented counter back to the entry()'s frame.

Fixes: dd691e847d28 ("s390/bpf: Implement bpf_jit_supports_subprog_tailcalls()")
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-3-iii@linux.ibm.com
arch/s390/net/bpf_jit_comp.c