Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s390/bpf: Pass through tail call counter in trampolines
[ Upstream commit a192103 ] 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: 528eb2c ("s390/bpf: Implement arch_prepare_bpf_trampoline()") Reported-by: Leon Hwang <[email protected]> Signed-off-by: Ilya Leoshkevich <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Sasha Levin <[email protected]>
- Loading branch information