summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/string_kfuncs.c
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2025-10-07 22:03:49 +0000
committerAlexei Starovoitov <ast@kernel.org>2025-10-10 10:04:51 -0700
commit5b1b5d380ac7de39e9cb9de4209719b3949ebd3c (patch)
treed06ab313435df1dd7fa7e4ad36bf57815e7a06e3 /tools/testing/selftests/bpf/prog_tests/string_kfuncs.c
parentf233d4855918547f19c5bff95223706d1c836b7c (diff)
selftests/bpf: Add tests for async cb context
Add tests to verify that async callback's sleepable attribute is correctly determined by the callback type, not the arming program's context, reflecting its true execution context. Introduce verifier_async_cb_context.c with tests for all three async callback primitives: bpf_timer, bpf_wq, and bpf_task_work. Each primitive is tested when armed from both sleepable (lsm.s/file_open) and non-sleepable (fentry) programs. Test coverage: - bpf_timer callbacks: Verify they are never sleepable, even when armed from sleepable programs. Both tests should fail when attempting to use sleepable helper bpf_copy_from_user() in the callback. - bpf_wq callbacks: Verify they are always sleepable, even when armed from non-sleepable programs. Both tests should succeed when using sleepable helpers in the callback. - bpf_task_work callbacks: Verify they are always sleepable, even when armed from non-sleepable programs. Both tests should succeed when using sleepable helpers in the callback. Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20251007220349.3852807-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/string_kfuncs.c')
0 files changed, 0 insertions, 0 deletions