Skip to content

Commit 94bde25

Browse files
iii-iAlexei Starovoitov
authored andcommitted
bpf: Pass the same orig_call value to trampoline functions
There is currently some confusion in the s390x JIT regarding whether orig_call can be NULL and what that means. Originally the NULL value was used to distinguish the struct_ops case, but this was superseded by BPF_TRAMP_F_INDIRECT (see commit 0c970ed ("s390/bpf: Fix indirect trampoline generation"). The remaining reason to have this check is that NULL can actually be passed to the arch_bpf_trampoline_size() call - but not to the respective arch_prepare_bpf_trampoline()! call - by bpf_struct_ops_prepare_trampoline(). Remove this asymmetry by passing stub_func to both functions, so that JITs may rely on orig_call never being NULL. Signed-off-by: Ilya Leoshkevich <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 5f55f21 commit 94bde25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/bpf_struct_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ int bpf_struct_ops_prepare_trampoline(struct bpf_tramp_links *tlinks,
601601
if (model->ret_size > 0)
602602
flags |= BPF_TRAMP_F_RET_FENTRY_RET;
603603

604-
size = arch_bpf_trampoline_size(model, flags, tlinks, NULL);
604+
size = arch_bpf_trampoline_size(model, flags, tlinks, stub_func);
605605
if (size <= 0)
606606
return size ? : -EFAULT;
607607

0 commit comments

Comments
 (0)