Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: kuniyu@google.com
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, kuni1840@gmail.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH v1 net-next 1/4] selftests: landlock: Replace MSG_OOB with O_ASYNC+F_SETSIG.
Date: Tue, 17 Nov 2026 17:19:30 +0000	[thread overview]
Message-ID: <179493597059.3136.12928298602383914551@kernel.org> (raw)
In-Reply-To: <20261116021845.2533130-2-kuniyu@google.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] After this patch, no landlock selftest reaches
  hook_file_send_sigiotask() through send_sigurg().

--

selftests: landlock: Replace MSG_OOB with O_ASYNC+F_SETSIG.

This commit removes MSG_OOB from the fown.sigurg_socket and
trace_fown.deny_scope_fown tests. They now do a plain send() to a socket
with O_ASYNC and F_SETSIG(SIGURG) set, so they no longer depend on
CONFIG_AF_UNIX_OOB. The commit also drops CONFIG_AF_UNIX_OOB from the
landlock selftest config, and it moves the close() of client_socket later
so that no extra POLL_HUP signal is sent.

> diff --git a/tools/testing/selftests/landlock/scoped_signal_test.c b/tools/testing/selftests/landlock/scoped_signal_test.c
> index 259cdcc8aa5cc..c4c365007370a 100644
> --- a/tools/testing/selftests/landlock/scoped_signal_test.c
> +++ b/tools/testing/selftests/landlock/scoped_signal_test.c

[ ... ]

> @@ -560,20 +539,22 @@ TEST_F(fown, sigurg_socket)
>  		create_scoped_domain(_metadata, LANDLOCK_SCOPE_SIGNAL);
>  
>  	/*
> -	 * Sets the child to receive SIGURG for MSG_OOB.  This uncommon use is
> +	 * Sets the child to receive SIGURG.  This uncommon use is
>  	 * a valid attack scenario which also simplifies this test.
>  	 */
>  	ASSERT_EQ(0, fcntl(recv_socket, F_SETOWN, child));
> +	ASSERT_EQ(0, fcntl(recv_socket, F_SETSIG, SIGURG));
> +	ASSERT_EQ(0, fcntl(recv_socket, F_SETFL, O_ASYNC));

[Severity: Low]
After this change, does any landlock selftest still reach
hook_file_send_sigiotask() through send_sigurg()?

fown.sigurg_socket and trace_fown.deny_scope_fown now reach the hook only
through the send_sigio() path:

  sock_wake_async()
    kill_fasync()
      send_sigio()
        send_sigio_to_task()
          sigio_perm()

The sigio_to_pgid_members and sigio_to_pgid_self tests in the same file
already cover that path. They use a pipe with F_SETSIG(SIGURG) and O_ASYNC.

The other caller is still in the kernel after AF_UNIX MSG_OOB is removed.
It is reachable from tcp_check_urg(), smc and x25:

  sk_send_sigurg()
    send_sigurg()
      send_sigurg_to_task()
        sigio_perm(p, fown, SIGURG)

The hook in security/landlock/task.c still names this caller:

hook_file_send_sigiotask() {
    ...
	/* Lock already held by send_sigio() and send_sigurg(). */
	lockdep_assert_held(&fown->lock);
    ...
}

The trace section comment also still says "Trace test for the asynchronous
SIGIO/SIGURG delivery path".

These tests would keep passing if send_sigurg_to_task() stopped calling
sigio_perm(), or called it without fown->lock held. The later patches in
this series (the sockmap and af_unix MSG_OOB test removals, and "af_unix:
Remove MSG_OOB") do not seem to add a replacement test for this path.

Could these tests use TCP urgent data over loopback instead? That reaches
sk_send_sigurg() without AF_UNIX OOB. If not, could the sigurg_socket name
and the comments be updated so they no longer claim send_sigurg() coverage?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116021845.2533130-1-kuniyu%40google.com

  reply	other threads:[~2026-11-17 17:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  2:18 [PATCH v1 net-next 0/4] af_unix: Drop MSG_OOB support Kuniyuki Iwashima
2026-11-16  2:18 ` [PATCH v1 net-next 1/4] selftests: landlock: Replace MSG_OOB with O_ASYNC+F_SETSIG Kuniyuki Iwashima
2026-11-17 17:19   ` netdev-bot+sashiko [this message]
2026-11-16  2:18 ` [PATCH v1 net-next 2/4] selftests: bpf: sockmap: Remove AF_UNIX MSG_OOB test case Kuniyuki Iwashima
2026-11-17 17:19   ` netdev-bot+sashiko
2026-11-16  2:18 ` [PATCH v1 net-next 3/4] selftests: af_unix: Remove MSG_OOB tests Kuniyuki Iwashima
2026-11-16  2:18 ` [PATCH v1 net-next 4/4] af_unix: Remove MSG_OOB Kuniyuki Iwashima
2026-11-17 17:19   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179493597059.3136.12928298602383914551@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox