From nobody Wed Sep 17 18:19:54 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E119F3054FF; Fri, 22 Aug 2025 14:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755871854; cv=none; b=K1ObAG61gyISksip1jXJjd5Wpio5rfdGs6G0F3s1z6Sr6q6h78lJ8QG9QsLk84gz+7vpJ7M3w1IF+gzJInkb5ocUVZPITv7PvOAjS4Eht0Rsdwm48KhXH1kIvlslcEiXgB+zY7KPtXB2A4uKY9MlrUdRA+B8in5TVMLlX7+XaYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755871854; c=relaxed/simple; bh=m3RPciZRUJTxht6jqLuNXkgSj4gAh8JTh0x49x8xy9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JB1ehm7esVfpUuK6+xaro7kNLG/03qU2wEY2K+p/kBz7jZ87gYGHdZadk4Q5/FuCE32cOJF0rCdeKcMzsrQd5xz9VVsPKdoJzebjCLJ2WPyVbuBfXGxYylfcn8BVKnRPBWL9zXa+E56750zcuwG1MF4pdd0861H6BxWUGp+O/pg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VAjqvg6n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VAjqvg6n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0ED67C113D0; Fri, 22 Aug 2025 14:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755871853; bh=m3RPciZRUJTxht6jqLuNXkgSj4gAh8JTh0x49x8xy9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VAjqvg6nTVk3xhMlwq6WgOBKzVykbzm7orn4hTV1FJV1+DvHZTPJHHSWS4DW0mdwx 21S/HcUDRH4pI784jOCtPISLtvZypj5ftLoo7Gf9tC30fE+Vw4F97xGu/mO2gl2SQS me7I+YdfmdiECUhgUcl2n91Uga2eswHyx4KX4douozChYWif32lqs1Q9aHcVG+w4VF If3H0UxQs2k82GI52hK/8hHtXO1aN0A9QaSnmbv2HXZncEbBwdddz2V1fESXEsBPMl aPvVZCkuJnN1cSOLqDT2Xv4PB57zeQnc05R6C9w7MzPZDpKT1GGO5DXhFsX4BeBFig dBVPyv9eM4PJg== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: Geliang Tang , sashal@kernel.org, Matthieu Baerts , Jakub Kicinski Subject: [PATCH 6.12.y 2/2] mptcp: disable add_addr retransmission when timeout is 0 Date: Fri, 22 Aug 2025 16:10:29 +0200 Message-ID: <20250822141026.47992-6-matttbe@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250822141026.47992-4-matttbe@kernel.org> References: <20250822141026.47992-4-matttbe@kernel.org> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3467; i=matttbe@kernel.org; h=from:subject; bh=cyFdfU0CTL6/31mJUJd0vVcxTVDhclKXQ2V2zci3y2w=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJWVIVZe+40FPhhF9lQ/zSNf/ZymY8u0p6ml5btT+Fj+ a55Xiujo5SFQYyLQVZMkUW6LTJ/5vMq3hIvPwuYOaxMIEMYuDgFYCIXdBn+V7zTWRyndTxVUk7u qnDQj231EkWJPQuYGrZbPomT/3n+AMN/RwObQyvsrtjcTv+w7szDkxtXlmaWTPKV3cdWtVpziuV mJgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang commit f5ce0714623cffd00bf2a83e890d09c609b7f50a upstream. When add_addr_timeout was set to 0, this caused the ADD_ADDR to be retransmitted immediately, which looks like a buggy behaviour. Instead, interpret 0 as "no retransmissions needed". The documentation is updated to explicitly state that setting the timeout to 0 disables retransmission. Fixes: 93f323b9cccc ("mptcp: add a new sysctl add_addr_timeout") Cc: stable@vger.kernel.org Suggested-by: Matthieu Baerts Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20250815-net-mptcp-misc-fixes-6-17-rc2-v1-5-= 521fe9957892@kernel.org Signed-off-by: Jakub Kicinski [ Before commit e4c28e3d5c09 ("mptcp: pm: move generic PM helpers to pm.c"), mptcp_pm_alloc_anno_list() was in pm_netlink.c. The same patch can be applied there without conflicts. ] Signed-off-by: Matthieu Baerts (NGI0) --- Documentation/networking/mptcp-sysctl.rst | 2 ++ net/mptcp/pm_netlink.c | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Documentation/networking/mptcp-sysctl.rst b/Documentation/netw= orking/mptcp-sysctl.rst index 95598c21fc8e..09be0e68b9af 100644 --- a/Documentation/networking/mptcp-sysctl.rst +++ b/Documentation/networking/mptcp-sysctl.rst @@ -12,6 +12,8 @@ add_addr_timeout - INTEGER (seconds) resent to an MPTCP peer that has not acknowledged a previous ADD_ADDR message. =20 + Do not retransmit if set to 0. + The default value matches TCP_RTO_MAX. This is a per-namespace sysctl. =20 diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 46f5f960472e..b763729b85e0 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -293,6 +293,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer) struct mptcp_pm_add_entry *entry =3D from_timer(entry, timer, add_timer); struct mptcp_sock *msk =3D entry->sock; struct sock *sk =3D (struct sock *)msk; + unsigned int timeout; =20 pr_debug("msk=3D%p\n", msk); =20 @@ -310,6 +311,10 @@ static void mptcp_pm_add_timer(struct timer_list *time= r) goto out; } =20 + timeout =3D mptcp_get_add_addr_timeout(sock_net(sk)); + if (!timeout) + goto out; + spin_lock_bh(&msk->pm.lock); =20 if (!mptcp_pm_should_add_signal_addr(msk)) { @@ -321,7 +326,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer) =20 if (entry->retrans_times < ADD_ADDR_RETRANS_MAX) sk_reset_timer(sk, timer, - jiffies + mptcp_get_add_addr_timeout(sock_net(sk))); + jiffies + timeout); =20 spin_unlock_bh(&msk->pm.lock); =20 @@ -363,6 +368,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, struct mptcp_pm_add_entry *add_entry =3D NULL; struct sock *sk =3D (struct sock *)msk; struct net *net =3D sock_net(sk); + unsigned int timeout; =20 lockdep_assert_held(&msk->pm.lock); =20 @@ -387,8 +393,9 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, =20 timer_setup(&add_entry->add_timer, mptcp_pm_add_timer, 0); reset_timer: - sk_reset_timer(sk, &add_entry->add_timer, - jiffies + mptcp_get_add_addr_timeout(net)); + timeout =3D mptcp_get_add_addr_timeout(net); + if (timeout) + sk_reset_timer(sk, &add_entry->add_timer, jiffies + timeout); =20 return true; } --=20 2.50.0