Netdev List
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: netdev-bot+sashiko@kernel.org, edumazet@google.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	weiwan@google.com, horms@kernel.org, caixinchen1@huawei.com,
	netdev@vger.kernel.org, edumazet@kernel.org
Subject: Re: [PATCH net 2/2] selftests/net: add SO_RESERVE_MEM test
Date: Fri, 25 Sep 2026 15:49:48 +0200	[thread overview]
Message-ID: <347e8fd4-ec24-4d45-a53e-88c933de10ad@kernel.org> (raw)
In-Reply-To: <179034054266.2160803.16187930067723490774@kernel.org>

Hi Eric,

Thank you for the new test.

On 25/09/2026 14:49, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 6 potential
> issue(s) to consider.

(...)
>> +static void check_non_tcp_rejected(struct __test_metadata *_metadata,
>> +				   int domain, int type, int protocol,
>> +				   int val)
>> +{
>> +	int fd = socket(domain, type, protocol);
>> +
>> +	if (fd < 0) {
>> +		EXPECT_TRUE(errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT);
>> +		return;
>> +	}
> 
> [Severity: Medium]
> Should ENOPROTOOPT be accepted here as well?
> 
> MPTCP can be built in but disabled with net.mptcp.enabled=0. In that case
> socket creation fails here:
> 
> net/mptcp/protocol.c:mptcp_init_sock() {
> 	...
> 	if (!mptcp_is_enabled(net))
> 		return -ENOPROTOOPT;
> 	...
> }
> 
> inet_create() passes that error back to userspace. As a result,
> socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP) in non_tcp_rejected fails with
> ENOPROTOOPT, and the EXPECT_TRUE fails the test.
> 
> The test doesn't unshare the network namespace, so it sees the host's
> sysctl. Any other environment-specific socket() errno also becomes an
> EXPECT failure rather than a skip.
Typically, we try to run the tests in a dedicated netns to avoid such
issues. (We also force net.mptcp.enabled=1 because it is still disabled
on RHEL, which is really a shame... but I don't think we really need to
support that here in the selftests.)

At the end, I don't think we need to care about all possible cases, but
using a netns is probably a good idea, at least not to "poison" other
tests. (If that's easy to put in place.)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


      parent reply	other threads:[~2026-09-25 13:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 12:36 [PATCH net 0/2] net: fix SO_RESERVE_MEM socket type restriction and value bounds Eric Dumazet
2026-09-24 12:36 ` [PATCH net 1/2] net: restrict SO_RESERVE_MEM to TCP sockets and cap max value Eric Dumazet
2026-09-24 17:32   ` Wei Wang
2026-09-25 12:49   ` netdev-bot+sashiko
2026-09-24 12:36 ` [PATCH net 2/2] selftests/net: add SO_RESERVE_MEM test Eric Dumazet
2026-09-25 12:49   ` netdev-bot+sashiko
2026-09-25 13:06     ` Eric Dumazet
2026-09-25 13:21       ` Eric Dumazet
2026-09-25 13:49     ` Matthieu Baerts [this message]

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=347e8fd4-ec24-4d45-a53e-88c933de10ad@kernel.org \
    --to=matttbe@kernel.org \
    --cc=caixinchen1@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=weiwan@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