From nobody Wed Sep 17 18:16:51 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 32A7030DED8; Fri, 22 Aug 2025 14:18:31 +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=1755872312; cv=none; b=YPBhk28i/ELAoNoptFSKs5iGl5MOrrpz06jLUh3xGq4YJ7u6JQnqW0+/1qz8yHfevm5ifQ38J6RJs7SsRAFBXEXiTGs8Pab06mWfPkp8zqyJm48ig8/Q+7QbVeF3grFhXHbhFtqQvA6HcQATlWHkZ6A754m0z4pOVqE63v0Hpkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755872312; c=relaxed/simple; bh=wj6qYoQgOlAvNYUPKgHUm5nwliIqmd/jrK9ZGCNqmOo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sj3AUIoI9hMgXNnYj6q941Vp+ci8om6k0egTBM1vkeMuYTNat4/Ln9udhmi7o+Wns2RG78KqHCglI24MdN/BmIVjeNCmIjm75Y5N84zCuQpeKAt/Ajlxpp+52hBchxp3ldyl7leBTBgCExmsHmup3w9ksyY9hCJkOFZ86NbeXwE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fSEMRmwb; 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="fSEMRmwb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5739AC4CEED; Fri, 22 Aug 2025 14:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755872311; bh=wj6qYoQgOlAvNYUPKgHUm5nwliIqmd/jrK9ZGCNqmOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSEMRmwbJyn4zvxPsdd+TkpUyKPGj3XX32TAedqtn7ofWcojBqw7Hip6KRmyh0xkx FeZzeK92fHvvqbdGRzG6VvMmpnHJf6lTEihUVA4eNLayDsy1T8ief8KEZSMbpZus4c B66GMjNVKyEkTrvNAIyNXZjOF4NhQ738jidIZeee+Tzx1BGXiBnAse3mYAT5yhJ1cV 2Gic+YpDNzwn6wLsJ4G2QQEZFa/pWtrzjAQgC1yVP4Ktn9c0Sm5GV71z0bi11AHYPG oEUGgUH8qlG/WQw0s/t9VTIvxtS04GqsTTOm0KGJ7rwri/OXYbMPEpdX+U1C/zf8EK hi9G0wTDX4w2w== 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 5.15.y 1/2] mptcp: disable add_addr retransmission when timeout is 0 Date: Fri, 22 Aug 2025 16:18:18 +0200 Message-ID: <20250822141816.61599-5-matttbe@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250822141816.61599-4-matttbe@kernel.org> References: <20250822141816.61599-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=3611; i=matttbe@kernel.org; h=from:subject; bh=iPh9S69BOfF9pftkb2npz+lLglgy/yPYgDpXTZU6ra4=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJW1GhLGT6TnF65PTcpaZ7Oy/1neG+2u6fz50c06HEdC s2+5/e2o5SFQYyLQVZMkUW6LTJ/5vMq3hIvPwuYOaxMIEMYuDgFYCKSjQz/vX1VputcfFfHOPEi q0VIx6Mte36dfa0aH7rhvfTpXdweHxkZ9husqtNj93UMcIj78b/6kGLumxs8KtNLDK8XHZi7+3Q hKwA= 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 with one small conflict, because the upstream parent commit, adding one label in the context, is not needed in this version. ] 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 b0d4da71e68e..e72ebaa14004 100644 --- a/Documentation/networking/mptcp-sysctl.rst +++ b/Documentation/networking/mptcp-sysctl.rst @@ -20,6 +20,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 7d32b4c4ed93..f9839980fcaf 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -316,6 +316,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 @@ -333,6 +334,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)) { @@ -344,7 +349,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 @@ -386,6 +391,7 @@ static 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 @@ -403,8 +409,9 @@ static bool mptcp_pm_alloc_anno_list(struct mptcp_sock = *msk, add_entry->retrans_times =3D 0; =20 timer_setup(&add_entry->add_timer, mptcp_pm_add_timer, 0); - 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