selftests/bpf: Add ksock test for async callback guard

Because the kfuncs are going through LSM hooks, allowing their use via
workqueue callbacks would expose the wrong credentials. This test
ensures the kfunc are preventing any use from these contexts.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20260813110540.103550-6-mahe.tardy@gmail.com
This commit is contained in:
Mahe Tardy 2026-08-13 11:05:40 +00:00 • committed by Daniel Borkmann
commit c93cbdb13f
2 changed files with 107 additions and 0 deletions