summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/linked_funcs.c
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2024-11-03 14:59:38 -0800
committerAlexei Starovoitov <ast@kernel.org>2024-11-03 16:52:06 -0800
commit46f7ed32f7a873d6675ea72e1d6317df41a55f81 (patch)
tree3d11db7072ae11a2d525edd334f19d93131f9255 /tools/testing/selftests/bpf/prog_tests/linked_funcs.c
parent77017b9c46820d72596e50a3986bd0734c1340a9 (diff)
bpf: Tighten tail call checks for lingering locks, RCU, preempt_disable
There are three situations when a program logically exits and transfers control to the kernel or another program: bpf_throw, BPF_EXIT, and tail calls. The former two check for any lingering locks and references, but tail calls currently do not. Expand the checks to check for spin locks, RCU read sections and preempt disabled sections. Spin locks are indirectly preventing tail calls as function calls are disallowed, but the checks for preemption and RCU are more relaxed, hence ensure tail calls are prevented in their presence. Fixes: 9bb00b2895cb ("bpf: Add kfunc bpf_rcu_read_lock/unlock()") Fixes: fc7566ad0a82 ("bpf: Introduce bpf_preempt_[disable,enable] kfuncs") Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20241103225940.1408302-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/linked_funcs.c')
0 files changed, 0 insertions, 0 deletions