]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Selftest to verify mixing bpf2bpf calls and tailcalls with insn patch
authorJohn Fastabend <john.fastabend@gmail.com>
Wed, 7 Jul 2021 22:38:48 +0000 (15:38 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 9 Jul 2021 10:08:40 +0000 (12:08 +0200)
commit764440e484fec5a8e3e322a5cd2ef27898db66e8
treea5eb64721247147d3aa1ee5c3d26954ab6743588
parent65947512902a5af94e3ee4e25ec7f3f89a8d403f
bpf: Selftest to verify mixing bpf2bpf calls and tailcalls with insn patch

This adds some extra noise to the tailcall_bpf2bpf4 tests that will cause
verify to patch insns. This then moves around subprog start/end insn
index and poke descriptor insn index to ensure that verify and JIT will
continue to track these correctly.

If done correctly verifier should pass this program same as before and
JIT should emit tail call logic.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210707223848.14580-3-john.fastabend@gmail.com
tools/testing/selftests/bpf/prog_tests/tailcalls.c
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf4.c