selftests: landlock: Replace MSG_OOB with O_ASYNC+F_SETSIG.
AF_UNIX will drop MSG_OOB support.
scoped_signal_test.c uses MSG_OOB in fown.sigurg_socket and
trace_fown.deny_scope_fown to trigger SIGURG and exercise
security_file_send_sigiotask().
The same hook can be exercised via send_sigio() with a plain send()
by setting O_ASYNC and F_SETSIG with SIGURG on recv_socket.
Let's replace MSG_OOB with O_ASYNC and F_SETSIG so that the tests
do not depend on CONFIG_AF_UNIX_OOB.
Note that with O_ASYNC set on recv_socket, closing client_socket
while recv_socket is still open also triggers SIGURG for POLL_HUP
in unix_release_sock(), which would emit an extra
landlock_deny_scope_signal trace event in
trace_fown.deny_scope_fown. Thus, the child waits for the parent
to close recv_socket via pipe_parent before closing client_socket.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261116021845.2533130-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 files changed