-
Notifications
You must be signed in to change notification settings - Fork 148
s390/bpf: Write back tail call counter #9465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: bf0c2a8 |
7390c2c
to
3a736b5
Compare
Upstream branch: 2caa6b8 |
7084ef1
to
02d50ad
Compare
3a736b5
to
c210f22
Compare
Upstream branch: 0786654 |
02d50ad
to
ac12b60
Compare
c210f22
to
2530e45
Compare
Upstream branch: dc0fe95 |
ac12b60
to
18acb38
Compare
2530e45
to
61c9cef
Compare
Upstream branch: c80d797 |
18acb38
to
17b23a8
Compare
61c9cef
to
715d6cb
Compare
Only BPF functions make use of the tail call counter; helpers and kfuncs ignore and most likely also clobber it. Writing it into these functions' frames is pointless and misleading, so do not do it. Fixes: dd691e8 ("s390/bpf: Implement bpf_jit_supports_subprog_tailcalls()") Signed-off-by: Ilya Leoshkevich <[email protected]>
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: dd691e8 ("s390/bpf: Implement bpf_jit_supports_subprog_tailcalls()") Signed-off-by: Ilya Leoshkevich <[email protected]>
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: 528eb2c ("s390/bpf: Implement arch_prepare_bpf_trampoline()") Signed-off-by: Ilya Leoshkevich <[email protected]>
…hy tests Clobbering a lot of registers and stack slots helps exposing tail call counter overwrite bugs in JITs. Signed-off-by: Ilya Leoshkevich <[email protected]>
Upstream branch: 3ec8560 |
17b23a8
to
e26b94b
Compare
Pull request for series with
subject: s390/bpf: Write back tail call counter
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=990991