Skip to content

Commit 86de564

Browse files
ameryhungAlexei Starovoitov
authored andcommitted
bpf: Allow syscall bpf programs to call non-recur helpers
Allow syscall programs to call non-recur helpers too since syscall bpf programs runs in process context through bpf syscall, BPF_PROG_TEST_RUN, and cannot run recursively. bpf_task_storage_{get,set} have "_recur" versions that call trylock instead of taking the lock directly to avoid deadlock when called by bpf programs that run recursively. Currently, only bpf_lsm, bpf_iter, struct_ops without private stack are allow to call the non-recur helpers since they cannot be recursively called in another bpf program. Signed-off-by: Amery Hung <[email protected]> Reviewed-by: Emil Tsalapatis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent a6923c0 commit 86de564

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/bpf_verifier.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ static inline bool bpf_prog_check_recur(const struct bpf_prog *prog)
962962
case BPF_PROG_TYPE_STRUCT_OPS:
963963
return prog->aux->jits_use_priv_stack;
964964
case BPF_PROG_TYPE_LSM:
965+
case BPF_PROG_TYPE_SYSCALL:
965966
return false;
966967
default:
967968
return true;

0 commit comments

Comments
 (0)