mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: sidchintamaneni@gmail.com
Cc: kuniyu@google.com, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, shuah@kernel.org,
	willemb@google.com, jannh@google.com, tkhai@ya.ru,
	apais@microsoft.com, rlmenge@gmail.com,
	hargar@linux.microsoft.com, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 4/4] selftest: af_unix: Test SIOCINQ and scm_fds with OOB and dgram disconnect.
Date: Tue, 10 Nov 2026 06:38:21 +0000	[thread overview]
Message-ID: <179429270185.994134.9244218175897635555@kernel.org> (raw)
In-Reply-To: <20261106051905.218638-5-sidchintamaneni@gmail.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] Two new tests in
  tools/testing/selftests/net/af_unix/scm_rights.c, oob_fdinfo() and…

--

selftest: af_unix: Test SIOCINQ and scm_fds with OOB and dgram disconnect.

This commit adds a SIOCINQ check to msg_oob's __resetpair() so that the
drained stream receive queue reports 0 unread bytes. It also adds
oob_fdinfo and dgram_disconnect_fdinfo tests to scm_rights.c. These check
that scm_fds in /proc/self/fdinfo/<fd> goes back to 0 when OOB skbs carrying
SCM_RIGHTS are skipped or freed, and when a dgram socket with queued
SCM_RIGHTS skbs disconnects.

> diff --git a/tools/testing/selftests/net/af_unix/scm_rights.c b/tools/testing/selftests/net/af_unix/scm_rights.c
> index c165f250220a4..38a125d9f6e49 100644
> --- a/tools/testing/selftests/net/af_unix/scm_rights.c
> +++ b/tools/testing/selftests/net/af_unix/scm_rights.c

[ ... ]

> @@ -395,4 +425,82 @@ TEST_F(scm_rights, mixed_lowpoint)
>  	close_sockets(6);
>  }
>  
> +TEST_F(scm_rights, oob_fdinfo)
> +{
> +	int recv_fd, ret;
> +	char buf[2];
> +
> +	if (!(variant->flags & MSG_OOB) || variant->disabled)
> +		return;

[Severity: Low]
Should these early returns use SKIP() instead?

In kselftest_harness, a plain return from a TEST_F body counts as a pass.
The scm_rights fixture has 10 variants, and oob_fdinfo() only does real
work on stream_oob and stream_listener_oob. The other 8 variants report
"ok" even though nothing was checked.

dgram_disconnect_fdinfo() later in this patch has the same pattern:

	if (variant->type != SOCK_DGRAM || variant->disabled)
		return;

It only runs on dgram and reports "ok" on the other 9 variants. That makes
17 TAP results that show as passes rather than "# SKIP".

The sibling test scm_rights_denial_lsm.c already uses this form:

	SKIP(return, "requires root");

Also, FIXTURE_SETUP and FIXTURE_TEARDOWN still run for these no-op cases.
FIXTURE_TEARDOWN(scm_rights) does this:

	if (variant->disabled)
		return;

	sleep(1);

So the no-op runs on non-disabled variants add about 7 seconds of runtime.
That is 3 for oob_fdinfo (dgram, stream, stream_listener) and 4 for
dgram_disconnect_fdinfo (stream, stream_oob, stream_listener,
stream_listener_oob).

> +
> +	create_sockets(2);
> +
> +	if (variant->test_listener) {
> +		recv_fd = accept(self->fd[0], NULL, NULL);
> +		ASSERT_LE(0, recv_fd);
> +	} else {
> +		recv_fd = self->fd[0];
> +	}

[ ... ]

> +TEST_F(scm_rights, dgram_disconnect_fdinfo)
> +{
> +	struct sockaddr addr = {
> +		.sa_family = AF_UNSPEC,
> +	};
> +	int ret;
> +
> +	if (variant->type != SOCK_DGRAM || variant->disabled)
> +		return;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106051905.218638-1-sidchintamaneni%40gmail.com

  reply	other threads:[~2026-11-10  6:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  5:19 [PATCH net 0/4] af_unix: Fix inq_len and scm_stat.nr_fds accounting leaks Siddharth Chintamaneni
2026-11-06  5:19 ` [PATCH net 1/4] af_unix: Fix inq_len leak when skipping unread OOB skb Siddharth Chintamaneni
2026-11-06  5:19 ` [PATCH net 2/4] af_unix: Fix scm_stat.nr_fds leaks for " Siddharth Chintamaneni
2026-11-10  6:38   ` netdev-bot+sashiko
2026-11-06  5:19 ` [PATCH net 3/4] af_unix: Fix scm_stat.nr_fds leak in unix_dgram_disconnected() Siddharth Chintamaneni
2026-11-10  6:38   ` netdev-bot+sashiko
2026-11-06  5:19 ` [PATCH net 4/4] selftest: af_unix: Test SIOCINQ and scm_fds with OOB and dgram disconnect Siddharth Chintamaneni
2026-11-10  6:38   ` netdev-bot+sashiko [this message]
2026-11-06  5:21 ` [PATCH net 0/4] af_unix: Fix inq_len and scm_stat.nr_fds accounting leaks netdev-bot+sinfo
2026-11-10  6:38 ` Kuniyuki Iwashima

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=179429270185.994134.9244218175897635555@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=apais@microsoft.com \
    --cc=edumazet@kernel.org \
    --cc=hargar@linux.microsoft.com \
    --cc=horms@kernel.org \
    --cc=jannh@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rlmenge@gmail.com \
    --cc=shuah@kernel.org \
    --cc=sidchintamaneni@gmail.com \
    --cc=tkhai@ya.ru \
    --cc=willemb@google.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

all inboxes | Powered by JetHome®