🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27152

[PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts

#27152
From: "Matthieu Baerts (NGI0)"
Date: Fri, 04 Dec 2026 21:44
43 lines
10194 bytes
From: Quanye Yang <quanyeyang@proton.me>

connect_one_server() reads the echoed payload in a loop because read()
on a stream socket can return a partial chunk. After the loop, it still
passed the last read() return value to do_getsockopts() instead of the
accumulated byte count.

do_getsockopts() checks MPTCP_INFO first. The client samples
mptcpi_write_seq before write(), and write() has already advanced
msk->write_seq by the full length, so a partial last read() makes
the write_seq assert fail. Pass the total instead.

This issue has been reported by Sashiko and not seen in CI environments.
Yet, it could be visible, especially when the test is launched manually.

Fixes: ce9979129a0b ("selftests: mptcp: add mptcp getsockopt test cases")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/638
Co-developed-by: Geliang Tang <tanggeliang@kylinos.cn>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Signed-off-by: Quanye Yang <quanyeyang@proton.me>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
index b6e58d936ebe..7b4ccbe10ae1 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
@@ -627,7 +627,7 @@ static void connect_one_server(int fd, int pipefd)
 	if (s.tcpi_rcv_delta)
 		assert(s.tcpi_rcv_delta <= total);
 
-	do_getsockopts(&s, fd, ret, ret);
+	do_getsockopts(&s, fd, total, total);
 
 	if (eof)
 		total += 1; /* sequence advances due to FIN */

-- 
2.55.0
Technical Details
Message-ID: <20261204-net-next-mptcp-misc-feat-7-5-v1-7-1449de51adae@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377656-linux-kernel-netdev=dewy.ru
References: <20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377656-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes
 to do_getsockopts
Date: Fri, 04 Dec 2026 22:44:39 +0100
Organization: Usenet Network
Message-ID: <20261204-net-next-mptcp-misc-feat-7-5-v1-7-1449de51adae@kernel.org>
References: <20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2878727"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:yub/kLbRnEfflrdDSvF4am2O8dg= sha256:a7tMlRdn+X2Ai1X1blENzszeo3YEJJ4QHqfLWGzwQD8=
	sha1:bd7afHxuZGoJj8CG8AFjCcoOce0= sha256:YinEPqJCvK2bI5u/FAVOcpE2+Cpgv9ei0kb+V6kInKg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id A99DA117CFC; Sat,  5 Dec 2026 00:45:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.542
X-Spam-Status: No, score=-3.542 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id j_dgDmZ7bDfb;
	Sat,  5 Dec 2026 00:45:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377656-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id DDBE0117CF9; Sat,  5 Dec 2026 00:45:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 2C1A03AFF1; Fri,  4 Dec 2026 21:45:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796420722;
	b=VfvohOOFvhkiEipP1BdGuUU4Yydgul/5+yTETs3cCPclSzGuVeTKw7Mgnq2XokSEveb6
	 fu+J4wNn934xfH54pTEWTib/UQmrHLOyAqHx+E0kFEuUh8gYEA7UU2b+gZY6tLtZz3bhA
	 dwZyptpZmg+hxKHXcTTzaR+nKc+DETnK4wVXXSHSDSprSZZhhWkGABhdcpwAQ2BV5zfYp
	 lcRX1Na9A/Jm7SJJn37crTRiwDi7YYNpsInH1uPzcerrp1QjpHGqdckehoPu+KClzcctV
	 CoL2DnWGKIaM1/WmRMo+8FeGMTFNsMxE67z5VQgZQ5pUUkbuT9pTLStN0pBsGiqwKdg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796420722;
	h=X-Original-To:Received:Received:DKIM-Signature:From:Date:Subject:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
	 X-Mailer:X-Developer-Signature:X-Developer-Key;
	bh=uoOL1haWtvBFzY6STjyN0nh41JLVmITjReEo+jqsW9U=;
	b=NVcFjmxfeLXTwINIcgcPV0A0pg92FyEZ1Kw0D5peO2PYmNxaNmCMDFw0x21tBFDnHXeI
	 8Eml3vtvOFLgCJusGfWnRT8b1UcA9Ge8gOIff72I6r9Q08F9P9S10O3bnbDUSJJnFr+sH
	 tQrDMvvu+k9hzmua86XDruQalMBAQaUemFNSG2nUQKjLc0sN2SF4QQpwR4Q8tLhKOxwva
	 fB0HUhknWmBcB1+hQ7eJ+1ynRoQvZlCktCYRaAHwWahpe1cjel45KBPylN4qIYMhQqVep
	 uAIITC/eYrgWby97oeraYPX7m3h/twnfnQOPdDZQelFV3SuCEEcoSz/mst7mAaJuVhg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="R66W/PFI";
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0429C606A334;
	Fri,  4 Dec 2026 21:45:22 +0000 (UTC)
X-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=R66W/PFI
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796420720;
	b=Dkb1ESK87aixzFfsTVyIE7OMiZz35sdNBvy3cAOoSuQ9rqgOM3ZZSy9BQnO3zNNc6AxD
	 6I02k/fE8pP0N3bD2/IdmjtBlDg2tBC+WKq8Ro6bKSESb241p52WFJ6lWf2luVaURiQkm
	 fQp68BDd6C5NnN9Rc2YBYi+S2+t42sPj9SO/WUdGkJpz3ISCwBOBclMyBVn1tmY0ZXpQA
	 wmOC/q/eP5AJ1xP06uvsod6KxBiiYrM4Wz515mIHNx3XMvEOH80lcMTnXl0PwHlgSNn+v
	 VKWoypi/Iee09YYeiE4kmCXi/GBQ8xnICVaBLrAtWuc9iC9OU6OFqFvdI/sKJSfrUQg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796420720;
	h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type:
	 Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
	 X-Mailer:X-Developer-Signature:X-Developer-Key;
	bh=uoOL1haWtvBFzY6STjyN0nh41JLVmITjReEo+jqsW9U=;
	b=p9X4YsO1TrqI+J1eyTRMjwijkAnYc533W4VptkeUc1RgS1W34jQAPeh5+OeY6VdTsVXa
	 1aZ1Fa9kCsjN0pg3YIYM+8+WFEhyHl8f4NatGv8GCemEL4+6im+VLZpu4+GBwtgFPPJ9K
	 jeAUbDWxeueb598+SkEsPsWNQewOqm3en6MUlF4sMpNYM2QIkZ93GZohC38pWf7JqDSE8
	 7pjjnW94bxAMsAxBE/CbIw2M+VK2SAshK+q1FzAAPr1Swxc1T6XZoWfEzXZTp81VFGRCK
	 gcITJLx8RhK0Kw6TrozEIiy7dOIgEaYD7SFQ3x2arIEMwXQwZO8slhP3LH7m84EqyNA==
X-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="R66W/PFI";
	arc=none smtp.remote-ip=100.103.45.18
X-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) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BDBE606A337;
	Fri,  4 Dec 2026 21:45:19 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F7331F0093B;
	Fri,  4 Dec 2026 21:45:17 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796420719;
	bh=uoOL1haWtvBFzY6STjyN0nh41JLVmITjReEo+jqsW9U=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=R66W/PFIkD306Is4qZFTK88cdskYpUzyWnMNJlp/xdADaHRu4sKaquGjx+CikH8uj
	 rHpfSAqUf0jAJPn1gGjjlYeJeG+FpTa1rwwwDWHVncbHMDFkN095zBgGJR+upz6U5z
	 uuA++eMSt9Oxj6637UUB9bNwnQ3p2mCuFOtn0fDnhQGW1Ez9F2I9w6I6bhEnVTFUwZ
	 IQUEaGfRxmJLijIDXXemXqmmVP8JBOfu3i1I2j0lJT7wNjfUnL4hafJKaILy2t/zWZ
	 cMqRP3G00LroQWVWvywJXDgbcPTRHfocYydUfZwS2HtVepler25i3KauZYlX7Iw4Cn
	 PNFyoovlxozMg==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae@kernel.org>
X-Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, 
 linux-kselftest@vger.kernel.org, 
 "Matthieu Baerts (NGI0)" <matttbe@kernel.org>, 
 Quanye Yang <quanyeyang@proton.me>, Geliang Tang <geliang@kernel.org>
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=1749; i=matttbe@kernel.org;
 h=from:subject:message-id; bh=ZhNXpZLhl92CBAJVenxzfqjelNDO6ALwugetYwyl13E=;
 b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLKFTUJuTROZsPWkwcWKmw9SK1ikd0Ress7ce4BFIrKtb
 sGlHRFZHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABOpmMjwP5PD2Pu966Uzx7cH
 aKfceGkqVWGSwPR72lF1uyWvDsxZ+53hf/jW5d8mM+jlT/1b9DNfLqa37J+vY3j61yTZJK53mxc
 k8wAA
X-Developer-Key: i=matttbe@kernel.org; a=openpgp;
 fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073