selftests/bpf: Add testcases for tailcall infinite loop fixing
authorLeon Hwang <hffilwlqm@gmail.com>
Tue, 12 Sep 2023 15:04:42 +0000 (23:04 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 12 Sep 2023 20:06:12 +0000 (13:06 -0700)
commite13b5f2f3ba3df1ca31824d2fdbd182250fa10c7
tree324fee63a59510365030d8588e5ff25733a9a580
parent2b5dcb31a19a2e0acd869b12c9db9b2d696ef544
selftests/bpf: Add testcases for tailcall infinite loop fixing

Add 4 test cases to confirm the tailcall infinite loop bug has been fixed.

Like tailcall_bpf2bpf cases, do fentry/fexit on the bpf2bpf, and then
check the final count result.

tools/testing/selftests/bpf/test_progs -t tailcalls
226/13  tailcalls/tailcall_bpf2bpf_fentry:OK
226/14  tailcalls/tailcall_bpf2bpf_fexit:OK
226/15  tailcalls/tailcall_bpf2bpf_fentry_fexit:OK
226/16  tailcalls/tailcall_bpf2bpf_fentry_entry:OK
226     tailcalls:OK
Summary: 1/16 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
Link: https://lore.kernel.org/r/20230912150442.2009-4-hffilwlqm@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/tailcalls.c
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf_fentry.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf_fexit.c [new file with mode: 0644]