From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796311339; b=ARf27Dg9FjzddtG6Z/Pr7zkEuhncTWCA+sccMFafhL+UyLhMDLfYxn5/9dtziPvS4wFJ qZ5P+oAU5zcTtd0K5CJCibOdm4+3qWD8hbcw7Tztl83PNgmTui1OXA53cYeMTyDui1HHQ wylsr/roQsJspvkTHbH6W5sYvzDyL8vIQpYz0pt2rpWvGEHsHFdVe8ehTT7rf3G5xqvL5 CqNqLIhoOri2qqLSWxO2tACOlTJvyYpC29uTzbii1736+e9YEPgTpkcw7LR3TcCqF7rp1 z356dYnJiudUi55nj/cr1eFi1og9U0tyImK5rlYd4qsApP8bOcgsZuZixEe9SqpWGmA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796311339; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=KEgR8p2//KXKaLsqEg6xSUuk5meQalwW45dnHdpz738=; b=If6C+Wo2AV1GG548S4+Sy/ypQJ/NNsOukx8DDBZshOt2bqeHR/Kv4zWYTOaZy5KbENms b8Fwi4kLDwtOVgHbTSLMSJfWZK4ZVXU5HHdiYeC3h43LztUGxpgHxaSguRm7sSHGpYIoV nHYMTVKV3q2Jgqs43MUohznNRuURvocB++cVJvHT1dL1BZiNSXgR+6Z5A0Bd7xYWxDVfB ViMHoakcn7y7C+vhE/6SP0lyUCpNLOn16fCjPVnfzdwmbY+5IUNOgFhxr2PL1uKFG5w8h O2QU6yxJ4HTByRKO+mjwhZH+rGa/PVscr+2LlDAssFLT51zmbqRyWWQNx+4LYEYuPNA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RHaPLAKZ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8930606A322 for ; Thu, 3 Dec 2026 15:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RHaPLAKZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5223F1F00893; Thu, 3 Dec 2026 15:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796311339; bh=KEgR8p2//KXKaLsqEg6xSUuk5meQalwW45dnHdpz738=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=RHaPLAKZ+SyUrsPZt7vgWplANUdA9FU0pXFMFxYTNJSDNB6f0ivqYUwE69Xw2GT8B Ts+b4wn5CfOd87RtBYGNhvxzuPy/rh88iHIelWDKORBzsusFZnO3jQGms9FBysrmS4 gYBl7DE13Vhnq5k1YrfzS+ZjmdFVsLVt5ImoY6mlyOedmcSU1gm/OjAlYr1BANvIbh Aeo04c4HQZSGSnxH5YjNMaUZ9mwgprlB6swsv81vv5xLHKanx6+v1/klgapB1lrKOR +ryOGdIwh1vjWrpD0RJBiioy9StJy+C7S2aGHnWoWWQ9HHE76++xDT/lIvIkQv8VYC dImz2XZ/iNTwQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH mptcp-next 2/2] selftests: mptcp: exercise socket option propagation and behavior Reply-To: sashiko-reviews@lists.linux.dev To: "Ruilin Mao" , mptcp@lists.linux.dev In-Reply-To: <179630953225.20.15369199654780650380.mptcp-525-0002@gmail.com> References: <179630953224.20.3586549954582163150.mptcp-525-0000@gmail.com> <179630953225.20.15369199654780650380.mptcp-525-0002@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 15:22:17 +0000 X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Medium] selftests/mptcp: rx_timestamp test races with async net_enable_timestamp() - [Low] selftests/mptcp: uninitialized buffer read in check_bound_device() - [Low] selftests/mptcp: buffer_sizes SO_SNDBUF 8192 doubles to default tcp_wmem[1] - [Low] selftests: mptcp: missing netns isolation and EADDRNOTAVAIL skip -- commit 10945eef75cc34706855384a71c16cd54ded5d2b Author: Ruilin Mao selftests: mptcp: exercise socket option propagation and behavior This commit adds a new kselftest harness binary, mptcp_sockopt_test, to verify listener socket option propagation onto fallback TCP children and software RX timestamping on MPTCP connections. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/525 > diff --git a/tools/testing/selftests/net/mptcp/Makefile b/tools/testing/s= elftests/net/mptcp/Makefile > index 22ba0da2adb85..a4c2a611dd5ed 100644 > --- a/tools/testing/selftests/net/mptcp/Makefile > +++ b/tools/testing/selftests/net/mptcp/Makefile > @@ -19,6 +19,8 @@ TEST_PROGS :=3D \ > userspace_pm.sh \ > # end of TEST_PROGS > =20 > +TEST_GEN_PROGS :=3D mptcp_sockopt_test > + > TEST_GEN_FILES :=3D \ > mptcp_connect \ > mptcp_diag \ [Severity: Low] Can running mptcp_sockopt_test directly in the host network namespace cause spurious failures from host sysctl settings? With net.ipv4.tcp_syncookies=3D2 on the host, tcp_conn_request() issues a S= YN cookie and the peer's bare ACK bypasses tcp_check_req() where rskq_defer_accept drops bare ACKs, waking the listener early and failing the poll() check in defer_accept. Running the test in an isolated network namespace (like the other MPTCP selftests, while keeping unprivileged runs working) avoids host sysctl interference. Separately, when IPv6 is disabled on lo via net.ipv6.conf.lo.disable_ipv6= =3D1 or ipv6.disable_ipv6=3D1, socket(AF_INET6, ...) still succeeds in FIXTURE_SETUP() and bind() in start_listener() fails with EADDRNOTAVAIL instead of skipping the IPv6 variant. > diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt_test.c b/too= ls/testing/selftests/net/mptcp/mptcp_sockopt_test.c > new file mode 100644 > index 0000000000000..48ca5522ed0b7 > --- /dev/null > +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt_test.c [ ... ] > +TEST_F(sockopt, rx_timestamp) > +{ [ ... ] > + connect_pair(_metadata, &self->server, IPPROTO_MPTCP, &client, &child); > + ASSERT_EQ(setsockopt(child, SOL_SOCKET, SO_TIMESTAMPING_NEW, &opt, opt= len), 0); > + ASSERT_EQ(write(client, &byte, 1), 1); > + ASSERT_EQ(recvmsg(child, &msg, 0), 1); > + ASSERT_EQ(msg.msg_flags & MSG_CTRUNC, 0); > + cmsg =3D CMSG_FIRSTHDR(&msg); > + ASSERT_NE(cmsg, NULL); [Severity: Medium] Can rx_timestamp race with asynchronous timestamping activation and fail flakily? Under CONFIG_JUMP_LABEL, when no other socket holds RX software timestamping active, net_enable_timestamp() defers enabling netstamp_needed_key to netstamp_work instead of enabling it synchronously: CPU0 (test / softirq) kworker setsockopt(SO_TIMESTAMPING_NEW) net_enable_timestamp() schedule_work(&netstamp_work) write(client, &byte, 1) loopback_xmit() skb_clear_tstamp(skb) __netif_rx(skb) net_timestamp_check() <-- netstamp_needed_key still off recvmsg(child, &msg, 0) <-- no cmsg, ASSERT_NE fails netstamp_clear() static_branch_enable(&netstamp_needed_key) Without a timestamp, __mptcp_recvmsg_mskq() omits the SO_TIMESTAMPING_NEW control message and ASSERT_NE(cmsg, NULL) fails. Waiting briefly before sending traffic (as tools/testing/selftests/net/rxtimestamp.c does) or retrying would avoid the race. [ ... ] > +static void check_bound_device(struct __test_metadata *_metadata, > + struct listener *server) > +{ > + int client, child; > + socklen_t len; > + char name[IFNAMSIZ]; > + > + start_listener(_metadata, server); > + connect_pair(_metadata, server, IPPROTO_TCP, &client, &child); > + len =3D sizeof(name); > + ASSERT_EQ(getsockopt(child, SOL_SOCKET, SO_BINDTODEVICE, name, &len), 0= ); > + ASSERT_STREQ(name, "lo"); [Severity: Low] Can ASSERT_STREQ() read uninitialized stack bytes from name[] if the child socket is not bound to a device? In net/core/sock.c, sock_getbindtodevice() returns 0 with *optlen set to 0 and leaves the caller's buffer untouched when bound_dev_if =3D=3D 0. On a regression where the binding does not propagate, ASSERT_STREQ() passes an uninitialized, non-NUL-terminated name[] to strcmp() and failure formatting. Zero-initializing name and checking ASSERT_EQ(len, sizeof("lo")) before ASSERT_STREQ() prevents that. [ ... ] > +TEST_F(sockopt, buffer_sizes) > +{ > + static const int opts[] =3D { SO_SNDBUF, SO_RCVBUF }; > + int child, client, size =3D 8192; > + unsigned int i; > + > + for (i =3D 0; i < ARRAY_SIZE(opts); i++) > + ASSERT_EQ(setsockopt(self->server.fd, SOL_SOCKET, opts[i], > + &size, sizeof(size)), 0); > + start_listener(_metadata, &self->server); > + connect_pair(_metadata, &self->server, IPPROTO_TCP, &client, &child); > + for (i =3D 0; i < ARRAY_SIZE(opts); i++) > + ASSERT_EQ(read_int_opt(_metadata, child, SOL_SOCKET, opts[i]), > + read_int_opt(_metadata, self->server.fd, SOL_SOCKET, opts[i])); [Severity: Low] Does setting SO_SNDBUF to 8192 leave sk_sndbuf at its initial default? sk_setsockopt() doubles the requested value to 16384, which equals the default sysctl_tcp_wmem[1] (16 * 1024) used for new TCP and MPTCP sockets, so this test would not catch a regression that fails to copy sk_sndbuf onto the child. Using a size whose doubled value differs from both default tcp_wmem[1] and tcp_rmem[1] (for example 12288) avoids matching the default. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/179630953224.20.358= 6549954582163150.mptcp-525-0000@gmail.com?part=3D2