]> 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)
commitdeea136698fe51c4124c52db03e4f3b8bbd45e4e
treea5eb64721247147d3aa1ee5c3d26954ab6743588
parentbfe75b6acb56f3843f532edd889ca10e584a89bb
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