OSDN Git Service

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)
commit1fb5ba29ad0835c5cbfc69a27f9c2733cb65726e
treea5eb64721247147d3aa1ee5c3d26954ab6743588
parentf263a81451c12da5a342d90572e317e611846f2c
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