Article View: linux.kernel.netdev
Article #2803[PATCH net 1/4] mptcp: reset msk state on early connect failure
From: "Matthieu Baerts (NGI0)"
Date: Tue, 13 Oct 2026 14:29
Date: Tue, 13 Oct 2026 14:29
50 lines
7752 bytes
7752 bytes
From: Quanye Yang <quanyeyang@proton.me>
mptcp_connect() can fall back before the subflow SYN is sent, for
example when the netns is in an MPTCP blackhole, token allocation fails,
or MD5SIG is in use. If the subsequent subflow connect() fails
immediately (EAFNOSUPPORT, ENETUNREACH, ...), __inet_stream_connect()
returns while the socket is still SS_UNCONNECTED and never calls
->disconnect(). This was reported by Clashiko [1].
The error path only dropped the token and moved the msk back to
TCP_CLOSE. MPTCP_FALLBACK_DONE, allow_subflows and
request_mptcp were left as after early fallback, so a later
connect() on the same fd stayed TCP-only.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/633 [1]
Fixes: 0235d075a592 ("mptcp: mark as fallback even early ones")
Cc: stable@vger.kernel.org
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>
---
net/mptcp/protocol.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index e89a69ab927c..e6f73a5ee630 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -4212,9 +4212,16 @@ static int mptcp_connect(struct sock *sk, struct sockaddr_unsized *uaddr,
* subflow_finish_connect()
*/
if (unlikely(err)) {
- /* avoid leaving a dangling token in an unconnected socket */
mptcp_token_destroy(msk);
mptcp_set_state(sk, TCP_CLOSE);
+
+ spin_lock_bh(&msk->fallback_lock);
+ msk->allow_subflows = true;
+ msk->allow_infinite_fallback = true;
+ clear_bit(MPTCP_FALLBACK_DONE, &msk->flags);
+ spin_unlock_bh(&msk->fallback_lock);
+
+ mptcp_subflow_ctx_reset(mptcp_subflow_ctx(ssk));
return err;
}
--
2.55.0
Technical Details
Message-ID:
<20261013-net-mptcp-misc-fixes-7-3-rc8-v1-1-932c9b182fc7@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345682-linux-kernel-netdev=dewy.ruReferences:
<20261013-net-mptcp-misc-fixes-7-3-rc8-v1-0-932c9b182fc7@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345682-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 1/4] mptcp: reset msk state on early connect failure
Date: Tue, 13 Oct 2026 16:29:19 +0200
Organization: Usenet Network
Message-ID: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-1-932c9b182fc7@kernel.org>
References: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-0-932c9b182fc7@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="2088795"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:hRu+zhETG0MEFYiA1Ey/6DU3XSM= sha256:UdTM+EKUwVpiX2Oe8UuzmftUr7bP85j2mLwWjtelOfg=
sha1:lIF1hbBlLRmRSebl+fsBNYG0Gaw= sha256:FoN2MfAxlKhj5TJjggmlfowqGGA+q8lIyq0ktUsinx4=
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 1A17B10FE70; Tue, 13 Oct 2026 18:37:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.44
X-Spam-Status: No, score=-1.44 tagged_above=-9999 required=6.31
tests=[DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
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 tMM0sylemt8G;
Tue, 13 Oct 2026 18:37:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-345682-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id AF95B10FE6C; Tue, 13 Oct 2026 18:37:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sto.lore.kernel.org (Postfix) with ESMTP id 05A9C61B301; Tue, 13 Oct 2026 14:37:12 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id B115950B8C8;
Tue, 13 Oct 2026 14:29:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fmuYpX9J"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
(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 8F79650AC30;
Tue, 13 Oct 2026 14:29:52 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791901793; cv=none; b=u/kac9vhyTDB5bVF2d1fUTYoAVz1AQOxAdp3a4xeYbOWBAs7cghv92a02yeWV4sKkzF9QPTXljMfTOzGh96FzWAs5g6ErziUIYKSBuS7mD2SUbQI6p7t0UZrVqgZ1gpPzsEWYIHHAkrJPPnhM01WRlIEFBUDXe/TcUOjXWDWUxs=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791901793; c=relaxed/simple;
bh=bKy5Oklgz8n6gkj5dfyaeFlXazXcC30okFNxUY7gjl0=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=Tjwqd3PXhxxeAOlKcUgoW2am4w5uu83la/3vziJn4cuwAHY4cMmix5WP0y/4iRuWE8T8Oj56oyBFY6H5oOvJK1fdAOaNw8bvpqBaoUDB1b/nypv37WmOuuXD+U5YETYmUZPo/vEBaYH3L01s5LhksyT0LqE6lvKYXYb0asEyTCM=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fmuYpX9J; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7CF81F00893;
Tue, 13 Oct 2026 14:29:49 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1791901792;
bh=Tto5KOWAoI1gJxTOOJjG6YNAV5y6e3OxsFdzPDbUl0Q=;
h=From:Date:Subject:References:In-Reply-To:To:Cc;
b=fmuYpX9JcZ+j50ySmf0IFrnZIzMzZRuaWcSEB1d//PNuBdRfDvEMOc/84uqdW8ZY2
2YVQ1K0lWUKvh040zVluqGmWuus1OCfPbeAFTxWwL5k9G2A0+MOzvDp1Ev16ZGyZeA
NsfHQYPGIFKaKQGu0UuXuaaFc8BAQ/JzAmzh+hpqz/rUlOifveP23QGPsi4jkIZzYX
tONC+21Emha5DFR7xoMtBwmLu9ZU/wVl6VMF58wwG/5UqU9sKAzVwEgR47ANJJatkN
OzVe8oxdim21oe5Hszl2XPwlfqU15bblck3CTuxtwKF/GMCIfr0IT/GUGVeh+HEseX
HPoA1OFU/X9uQ==
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-0-932c9b182fc7@kernel.org>
X-Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
Quanye Yang <quanyeyang@proton.me>, stable@vger.kernel.org
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=1793; i=matttbe@kernel.org;
h=from:subject:message-id; bh=2lbUcr8HsAkGQq5oDGKp8tCE0/67cLkwLj9/f5Hi7jc=;
b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLOOYQr+GXUPPibHh6+PvDks6YdCR5Gt4VySrUv57yMu
aPJ6xjdUcrCIMbFICumyCLdFpk/83kVb4mXnwXMHFYmkCEMXJwCMBFjLUaGyTMmy9pYitXXfDSb
Z9D3/1lpZZWvv+Ryp/T20OVHEkusGRmWP7hum55w8fLby4IbH5x1FCh0EzX6IqT52nPKJNdvUYE
MAA==
X-Developer-Key: i=matttbe@kernel.org; a=openpgp;
fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073