selftests/bpf: Add tests for restricted helpers
authorDmitrii Banshchikov <me@ubique.spb.ru>
Sat, 13 Nov 2021 14:22:27 +0000 (18:22 +0400)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 16 Nov 2021 04:37:11 +0000 (20:37 -0800)
commite60e6962c503f337531f80e2752423b5bd885443
tree6d029ea816351ee368667c1244935862b898aeb1
parent5e0bc3082e2e403ac0753e099c2b01446bb35578
selftests/bpf: Add tests for restricted helpers

This patch adds tests that bpf_ktime_get_coarse_ns(), bpf_timer_* and
bpf_spin_lock()/bpf_spin_unlock() helpers are forbidden in tracing progs
as their use there may result in various locking issues.

Signed-off-by: Dmitrii Banshchikov <me@ubique.spb.ru>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211113142227.566439-3-me@ubique.spb.ru
tools/testing/selftests/bpf/prog_tests/helper_restricted.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_helper_restricted.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_verifier.c
tools/testing/selftests/bpf/verifier/helper_restricted.c [new file with mode: 0644]