summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2023-09-06 02:44:19 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2023-09-06 10:48:14 +0200
commita192103a11465e9d517975c50f9944dc80e44d61 (patch)
tree94a2d8986e02e3b5f3c1e3d7ee215fbf71bb38a7 /kernel
parent6764e767f4af1e35f87f3497e1182d945de37f93 (diff)
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: 528eb2cb87bc ("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
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions