Skip to content

Commit 0c970ed

Browse files
Alexei Starovoitovborkmann
authored andcommitted
s390/bpf: Fix indirect trampoline generation
The func_addr used to be NULL for indirect trampolines used by struct_ops. Now func_addr is a valid function pointer. Hence use BPF_TRAMP_F_INDIRECT flag to detect such condition. Fixes: 2cd3e37 ("x86/cfi,bpf: Fix bpf_struct_ops CFI") Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Ilya Leoshkevich <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 42d45c4 commit 0c970ed

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

arch/s390/net/bpf_jit_comp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
23622362
return -ENOTSUPP;
23632363

23642364
/* Return to %r14, since func_addr and %r0 are not available. */
2365-
if (!func_addr && !(flags & BPF_TRAMP_F_ORIG_STACK))
2365+
if ((!func_addr && !(flags & BPF_TRAMP_F_ORIG_STACK)) ||
2366+
(flags & BPF_TRAMP_F_INDIRECT))
23662367
flags |= BPF_TRAMP_F_SKIP_FRAME;
23672368

23682369
/*
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# TEMPORARY
22
# Alphabetical order
3-
dummy_st_ops/dummy_init_ret_value
4-
dummy_st_ops/dummy_init_ptr_arg
53
exceptions # JIT does not support calling kfunc bpf_throw (exceptions)
64
get_stack_raw_tp # user_stack corrupted user stack (no backchain userspace)
75
stacktrace_build_id # compare_map_keys stackid_hmap vs. stackmap err -2 errno 2 (?)

0 commit comments

Comments
 (0)