🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27148

[PATCH net-next 04/10] mptcp: pm: keep an RM_ADDR when computing the MSS

#27148
From: "Matthieu Baerts (NGI0)"
Date: Fri, 04 Dec 2026 21:44
107 lines
12241 bytes
tcp_current_mss() calls mptcp_established_options() without skb, to
know the size of the options. A pending RM_ADDR was then taken: its
signal bit was cleared, and RmAddrTx was incremented, but it was not
sent. The peer then never learnt that the address was not valid any
more. An ADD_ADDR is not affected: it is only sent with a pure ACK.

Without skb, only reserve the size of the RM_ADDR, and keep it pending
for the packet that will be sent.

This issue has been reported by Clashiko, while reviewing commit
"mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR", and
confirmed with a script: data was sent while the RM_ADDR was pending.
RmAddrTx was then 1 on the sender, but RmAddr 0 on the receiver.

Fixes: 5cb104ae55e9 ("mptcp: add the outgoing RM_ADDR support")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/options.c  | 12 +++++++++---
 net/mptcp/pm.c       |  8 ++++++--
 net/mptcp/protocol.h |  3 ++-
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 617358ff7f99..3b10884526b0 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -762,7 +762,8 @@ static bool mptcp_established_options_add_addr(struct sock *sk,
 	return true;
 }
 
-static bool mptcp_established_options_rm_addr(struct sock *sk, int *size,
+static bool mptcp_established_options_rm_addr(struct sock *sk,
+					      struct sk_buff *skb, int *size,
 					      unsigned int remaining,
 					      struct mptcp_out_options *opts)
 {
@@ -772,9 +773,13 @@ static bool mptcp_established_options_rm_addr(struct sock *sk, int *size,
 	int i;
 
 	if (!mptcp_pm_should_rm_signal(msk) ||
-	    !(mptcp_pm_rm_addr_signal(msk, remaining, &rm_list, size)))
+	    !(mptcp_pm_rm_addr_signal(msk, remaining, &rm_list, size, !skb)))
 		return false;
 
+	/* without skb, only the size is needed: keep it for the next packet */
+	if (!skb)
+		return true;
+
 	opts->suboptions |= OPTION_MPTCP_RM_ADDR;
 	opts->rm_list = rm_list;
 
@@ -933,7 +938,8 @@ int mptcp_established_options(struct sock *sk, struct sk_buff *skb,
 		total_size += opt_size;
 		remaining -= opt_size;
 		ret = true;
-	} else if (mptcp_established_options_rm_addr(sk, &opt_size, remaining, opts)) {
+	} else if (mptcp_established_options_rm_addr(sk, skb, &opt_size,
+						     remaining, opts)) {
 		total_size += opt_size;
 		remaining -= opt_size;
 		ret = true;
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index f12a8bfbb2a9..1d114e3b3284 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -1016,7 +1016,8 @@ static int mptcp_rm_addr_len(const struct mptcp_rm_list *rm_list)
 }
 
 bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
-			     struct mptcp_rm_list *rm_list, int *size)
+			     struct mptcp_rm_list *rm_list, int *size,
+			     bool size_only)
 {
 	int ret = false, len;
 	u8 rm_addr;
@@ -1037,9 +1038,12 @@ bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
 		goto out_unlock;
 
 	*size = len;
+	ret = true;
+	if (size_only)
+		goto out_unlock;
+
 	*rm_list = msk->pm.rm_list_tx;
 	WRITE_ONCE(msk->pm.addr_signal, rm_addr);
-	ret = true;
 
 out_unlock:
 	spin_unlock_bh(&msk->pm.lock);
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 7644651f01a8..255b2e761f7d 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1243,7 +1243,8 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, int *size, int remaining,
 			      struct mptcp_addr_info *addr, bool *echo,
 			      bool *drop_ts);
 bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
-			     struct mptcp_rm_list *rm_list, int *len);
+			     struct mptcp_rm_list *rm_list, int *len,
+			     bool size_only);
 int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc);
 int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk,
 			     struct mptcp_pm_addr_entry *skc);

-- 
2.55.0
Technical Details
Message-ID: <20261204-net-next-mptcp-misc-feat-7-5-v1-4-1449de51adae@kernel.org>
Path: mbox-mo1.pugleaf.net!news-sfo.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377653-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!news-sfo.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377653-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 04/10] mptcp: pm: keep an RM_ADDR when computing the MSS
Date: Fri, 04 Dec 2026 22:44:36 +0100
Organization: Usenet Network
Message-ID: <20261204-net-next-mptcp-misc-feat-7-5-v1-4-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="2878286"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:AviZBW1jPybsZDwRd5UaQj6zQ6A= sha256:wUSi0MQBDnO0Xeh8xs91L+3gW6exsD5v8dlBt+kG4DU= sha1:72C1VIpIkkJd2UygI++CBI1JVIM= sha256:k2WSJYZd5Kxlk9KUGl6qosLLWtCsK2arSOKrK07m3yI=
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 40322117CED; Sat,  5 Dec 2026 00:45:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.642
X-Spam-Status: No, score=-3.642 tagged_above=-9999 required=6.31 tests=[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 gZxaOMgk6Bqa; Sat,  5 Dec 2026 00:45:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377653-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id C17DB117CF5; Sat,  5 Dec 2026 00:45:13 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id BABE126705; Fri,  4 Dec 2026 21:45:11 +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=1796420711; b=BNGGW+q8ImX/UOY4s92ngi1a86heVN8VVb9ScW/Vd+ENOGQIYVdCbNht5+BGnGBa9N6M Gu4ozrjSXjBHZds4TC9svJL4wKb4RMcWPGLLazGZUVTUiUSvyUHhMxWzMekLH4NpCoqtQ oo/0r684Wsh6U/dDtpKZyk0qmCNh+/biMjd0EuqAjdzccMD2u+WGY/AuPtyplRshmm1Qx rI2U6gFnaWznP4oogko5Gfijt9MKu9U0ptseYmWOHeLLrEGLQDcDeT1smE5GGLnEpd1fh ZDT8RUqHRSF1SOAHQqJpSfQ9is6eI5Yby36kKIuyLyMC6KkmXftUGrAx/q/qQCqeIew==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420711; 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=B3As8HDg5QUNU7oC8xi2KgBi3VbA/SVV3dxBgp8OeIo=; b=2G1xfh6JVBbv+mWeNh8WO2Y+yNgeBvv3EtXlkcTlEwRKQoDx717lV1pPZOkXc4SSGg5i QHeQzo+o+zes1S+onJa3spoPuHOCROFLdMHgXilLmcOmbRIr5/ePfbobd5vUyTaquk9+I 5Yd6+nVbnloGKAsxZ8fHKleMt9ZfK/OxzL3YpqO+2NfgOpZhPPJw9a3azvo5eVgRN5quO l9ROQv/UCslcu1ADX39iyId2y6Ld7OfNFMgVvI6DBvVKwyaYlb9Tp72mCvs7NCWHpG5MR yHVB4V/ci2HE3uDwBMKJsyhG83Nr+9T44wQbDBkY0B7BPs/HNOKWJXoKQ2dqsc7+iAA==
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=laJYZA9U; 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 598B6606A680; Fri,  4 Dec 2026 21:45:11 +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=laJYZA9U
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=1796420710; b=U4d7f4P7xaOtioqnB74OREZsbS6idmlclWB+zM+t/F7JY7F4ff3Bi21Q/ioPRGAVx4l/ 0DzaNphL9ORAYzMQoBZs6w/5Ap6yZGhTVk387gfv2pcgji6GYTc4faci1uwj9ZrVOz2sT 8+T4wlhWep/MAWKBnff19VuZuANoA+TpOcFXCM3ypi/g5vxj0lfiidEw4dcwuX2OlcY4E +ypjapqQYcHVoTIYh84XQn+LAIr2f4mmlk4ZNTCDyYQ5r5cKsnEIiEKBfkJ4FJpU6Umf/ /+xMoktcl73toqrNp4NVYScLTfNdmpCSYJBrElWYOl+NdXbeiVCcXX5qU0AB87DllZA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420710; 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=B3As8HDg5QUNU7oC8xi2KgBi3VbA/SVV3dxBgp8OeIo=; b=dnC5zt1j/lOfBOk/Mpmucx0Iu4b2K//9Cu0tmCC/DiXBvxXkwn9gc6vUKvmReu6ocKHs rce8YPGRMDzkpR1HyljiJHwV65oJ/JWfXw3DWCAAq9C0Kr1ChjqJundqM4s0Ln/iBcR2i zvA19bt6N56Xf770fsJsWZtm9DJVDFDLoyo45hyzt3xOLgf2MF/RlxTr0TZQAmbw0nP27 MjHXshMOqnp8UE5Lz3qghsHEoKGLYbvqYh5EMBi86fWCcSwyFeD8uflaQSiIh6C63STYQ 1Vdys2eCCcZ8dtdoRpYdob+5iSus5bjj+j9i3lC2vsfiqBIR9mpe7QettTVUHrQCPdg==
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=laJYZA9U; 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)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75A00606A32D; Fri,  4 Dec 2026 21:45:10 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D41E61F00A13; Fri,  4 Dec 2026 21:45:07 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796420710; bh=B3As8HDg5QUNU7oC8xi2KgBi3VbA/SVV3dxBgp8OeIo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=laJYZA9UhpsHvf3tW28jBQ/oq0AzCS23WB8UhLiUrXFOyO7nKAxsuzQSLNWNqDDzC I4hy/133MXk80vDRGfN+JSzZ3HLMmnBouDC6MXK2ttnv+xnM0/36/PyE7aooFx3dmq +SKpxpgiqyZ6/Ei0jM4dtDIDmEpxLaCPcInLR2mhTvfkhJuZ1zsftPyEh8htQdvVAX Wd13+QVQ8rExPZqujohl5ETvEi7+TOK1/4PzBxT0NyqtsesJfDdKgkuLbAxJ89jCNh aP/FlkzWsEWs9dBDa89AlvX7c95DcbAI/BcCJn6Nq1DSAnMKeLp7KDK4u/MtpCPPU6 d05ZxnjUmiZLw==
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>
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=4024; i=matttbe@kernel.org; h=from:subject:message-id; bh=tBXfnvNd8kfxlEdeWXbp7pEWazpGyeVGT3s+rGnaITY=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLKFTQKD+LPspnJn8le/2PD7sFJGtp4O+xThF3aT9T00E pL+KOV2lLIwiHExyIopski3RebPfF7FW+LlZwEzh5UJZAgDF6cATOQ3KyPDsjtZ+gfLsh7IX6zP VazI6Zz+uF766Eul7QzC7YfdPSOmM/yPd8//JLIwNCZvbdTb3ecvz9gxUSvhvNgv1llpx66KXbn NCAA=
X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073
X-Received-Bytes: 12044