From nobody Wed Sep 17 16:19:50 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 From nobody Wed Sep 17 16:19:50 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 1D0D630DED8; Fri, 22 Aug 2025 14:18:33 +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=1755872315; cv=none; b=SrRn9CMEpFNhdVdejNbGbUpEOOPMBG9HmGo9Ln3i31MvrWEjZ3MNoIZ4qh7f+CchUda47NnYcxT4ObuY2kIvkhiM9Kq+N7tbr0BiR+4ar2AX3lojTZFkUv/V89Y7FXc3do985/9WRwDjO0cjMEvg3mSAxxGtuYZmo4k3abdlhTU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755872315; c=relaxed/simple; bh=6bFa9fPxNY3+q5whHPEc+1EaORiYqtuwfH3QyCrobYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GU8TAaArkuGmtsS0bOx2ry8IaDVsQ1JyMGJqiRJVCHJ2z9+u+JNNJavNkH9p9ioGUYcr9kAfSNxcX0pTvqnc4vwAxCoNA3aYuTYBj7eYaNwlu2KVQf7FHoLv6oxfGxzyLXrtzzJY8xT3XICK9L8z6G+yyBl1Wb/SlpDu203SZ9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u0VmuuER; 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="u0VmuuER" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35401C113CF; Fri, 22 Aug 2025 14:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755872313; bh=6bFa9fPxNY3+q5whHPEc+1EaORiYqtuwfH3QyCrobYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u0VmuuER3NUzjs25xmrHUXxcdJo2GrfiuzDw6ZurIgH3g4YXhkr/w5VezVU0BuBgE HvwDqobXnK2p/S6dxk3DsvlkhRSEyv7OMPk9tvQaqrISqew+i1HLs5udoi8l5Sxo6/ opm4hQCxeUEUYcyhcvydo2y8yh/loggWKD3xRkInc9U5kcB+PE9CduOX3II28QkIaL GX/kr8kw3lo0pCuTrLurrsGsoBC9hkluuLYbSjlLPCzAjBTa5/qagzKXgt3bQ2mmMS PT8uM0a0KXY2F7cWo4A0pFGROrNazY0asR96TyPkhFY9e3VCxJiK8jHCzYMgHKHwuN JcYcn014t5g1w== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , sashal@kernel.org, Mat Martineau , Jakub Kicinski Subject: [PATCH 5.15.y 2/2] selftests: mptcp: pm: check flush doesn't reset limits Date: Fri, 22 Aug 2025 16:18:19 +0200 Message-ID: <20250822141816.61599-6-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=1989; i=matttbe@kernel.org; h=from:subject; bh=6bFa9fPxNY3+q5whHPEc+1EaORiYqtuwfH3QyCrobYA=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJW1Og4NLl8E5v8UfRvymfThzsz12hVnLvy7Hl69omc8 0U9R5496yhlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZiIfTDDf7f8Jcp/Pj6c7bOA YcvbjSnvt1tbL2CMU1RoSJR7yiIb+IiR4azBBs3bHS9Ef/h2zrwtef9P18WvD4rlent8p1RJcW2 9xwIA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit 452690be7de2f91cc0de68cb9e95252875b33503 upstream. This modification is linked to the parent commit where the received ADD_ADDR limit was accidentally reset when the endpoints were flushed. To validate that, the test is now flushing endpoints after having set new limits, and before checking them. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 01cacb00b35c ("mptcp: add netlink-based PM") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20250815-net-mptcp-misc-fixes-6-17-rc2-v1-3-= 521fe9957892@kernel.org Signed-off-by: Jakub Kicinski [ Conflicts in pm_netlink.sh, because some refactoring have been done later on: commit 3188309c8ceb ("selftests: mptcp: netlink: add 'limits' helpers") and commit c99d57d0007a ("selftests: mptcp: use pm_nl endpoint ops") are not in this version. The same operation can still be done at the same place, without using the new helper. ] Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testin= g/selftests/net/mptcp/pm_netlink.sh index 306372b1526a..68e05bd3526e 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -131,6 +131,7 @@ ip netns exec $ns1 ./pm_nl_ctl limits 1 9 check "ip netns exec $ns1 ./pm_nl_ctl limits" "$default_limits" "subflows = above hard limit" =20 ip netns exec $ns1 ./pm_nl_ctl limits 8 8 +ip netns exec $ns1 ./pm_nl_ctl flush check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 8 subflows 8" "set limits" =20 --=20 2.50.0