selftests/bpf: Add lazy global subprog validation tests
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 24 Nov 2023 03:59:37 +0000 (19:59 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 24 Nov 2023 09:40:06 +0000 (10:40 +0100)
commite8a339b5235e294f29153149ea7cf26a9a87dbea
tree11c36122a9d80c9c3ad9525f47973326ae348c30
parent2afae08c9dcb8ac648414277cec70c2fe6a34d9e
selftests/bpf: Add lazy global subprog validation tests

Add a few test that validate BPF verifier's lazy approach to validating
global subprogs.

We check that global subprogs that are called transitively through
another global subprog is validated.

We also check that invalid global subprog is not validated, if it's not
called from the main program.

And we also check that main program is always validated first, before
any of the subprogs.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20231124035937.403208-4-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/verifier.c
tools/testing/selftests/bpf/progs/verifier_global_subprogs.c [new file with mode: 0644]