OSDN Git Service

selftests/bpf: Add selftest for check_stack_max_depth bug
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Wed, 5 Jul 2023 14:47:30 +0000 (20:17 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 6 Jul 2023 02:14:54 +0000 (19:14 -0700)
commit906bd22a44c7c381ae92996129b075ea7beba8f6
tree3404326742151691048ad7399fff6bc35dcaa728
parent5415ccd50a8620c8cbaa32d6f18c946c453566f5
selftests/bpf: Add selftest for check_stack_max_depth bug

Use the bpf_timer_set_callback helper to mark timer_cb as an async
callback, and put a direct call to timer_cb in the main subprog.

As the check_stack_max_depth happens after the do_check pass, the order
does not matter. Without the previous fix, the test passes successfully.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20230705144730.235802-3-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/async_stack_depth.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/async_stack_depth.c [new file with mode: 0644]