]> git.hungrycats.org Git - linux/commit
selftests/bpf: Test epilogue patching when the main prog has multiple BPF_EXIT
authorMartin KaFai Lau <martin.lau@kernel.org>
Thu, 29 Aug 2024 21:08:31 +0000 (14:08 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 30 Aug 2024 01:15:45 +0000 (18:15 -0700)
commitcada0bdcc471443dbd41bd63286f48be3dae0d89
treef51686d057312ce2b455de8613d6c8ea5668a89f
parent42fdbbde6cf4159f77de13a40f8c0be6ef48bcc1
selftests/bpf: Test epilogue patching when the main prog has multiple BPF_EXIT

This patch tests the epilogue patching when the main prog has
multiple BPF_EXIT. The verifier should have patched the 2nd (and
later) BPF_EXIT with a BPF_JA that goes back to the earlier
patched epilogue instructions.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240829210833.388152-10-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/pro_epilogue.c
tools/testing/selftests/bpf/progs/epilogue_exit.c [new file with mode: 0644]