selftests/seccomp: Add test for wait killable notifier
authorSargun Dhillon <sargun@sargun.me>
Tue, 3 May 2022 08:09:58 +0000 (01:09 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 3 May 2022 21:20:49 +0000 (14:20 -0700)
commit3b96a9c522b2ee267fa1f46943ebc5d9cdd7b3dc
tree0fd5a8e629e0bcbeb5ff0428a6e4d0c42f4fa3d8
parent922a1b520c5ffb09079dddeb0c686f9c008a9923
selftests/seccomp: Add test for wait killable notifier

This verifies that if a filter is set up with the wait killable feature
that it obeys the semantics that non-fatal signals are ignored during
a notification after the notification is received.

Cases tested:
 * Non-fatal signal prior to receive
 * Non-fatal signal during receive
 * Fatal signal after receive

The normal signal handling is tested in user_notification_signal. That
behaviour remains unchanged.

On an unsupported kernel, these tests will immediately bail as it relies
on a new seccomp flag.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220503080958.20220-4-sargun@sargun.me
tools/testing/selftests/seccomp/seccomp_bpf.c