🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #619

[PATCH v3] mptcp: push queued data on passive TFO subflows becoming established

#619
From: T S Rameshkumar
Date: Thu, 08 Oct 2026 10:48
54 lines
9980 bytes
With TCP Fast Open on an MPTCP listener, if the server application
writes data while the passive subflow is still in SYN_RECV (after
consuming the client's SYN data but before the MP_CAPABLE third ACK
arrives), __mptcp_subflow_active() refuses transmission and the data
is queued into the msk write queue.

When the MPC third ACK arrives, the subflow transitions to
TCP_ESTABLISHED and is marked fully established in
check_fully_established(), but because the third ACK carries no
DSS data, the queued bytes remain stranded until the peer sends
more data.

Fix this in check_fully_established() by checking if the subflow
was doing passive TFO (subflow->is_mptfo). Under mptcp_data_lock(),
flush queued bytes via __mptcp_check_push() and clear is_mptfo.

Reported-by: Petar Sakic <petar.sakic@ink.fish>
Closes: https://lore.kernel.org/netdev/CAFPPu1gU2Y-D+d4i3F0MoNkYK+e1U+=X3qf6QycjfKBw+8snPg@mail.gmail.com/
Fixes: fb7084501a61 ("mptcp: add support for TCP_FASTOPEN sockopt")
Signed-off-by: T S Rameshkumar <rameshkumar.t@phytecembedded.in>
---
v2 -> v3:
 - Move the push and is_mptfo reset directly into check_fully_established()
   under mptcp_data_lock(), avoiding any potential race in subflow_state_change()
   which could clear is_mptfo before check_fully_established() processes the 3rd ACK.
v1 -> v2:
 - Use __mptcp_check_push() under mptcp_data_lock() instead of mptcp_push_pending().

 net/mptcp/options.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index ce0de02f5..b865ee6af 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1042,6 +1042,15 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 
 	mptcp_data_lock((struct sock *)msk);
 	__mptcp_subflow_fully_established(msk, subflow, mp_opt);
+	/* Passive TFO: the application may have written data while the
+	 * subflow was still in SYN_RECV; __mptcp_subflow_active() refused
+	 * it then and nothing else spools the msk write queue when the
+	 * MPC third ack (no DSS) arrives. Push it now.
+	 */
+	if (subflow->is_mptfo) {
+		subflow->is_mptfo = 0;
+		__mptcp_check_push((struct sock *)msk, ssk);
+	}
 	mptcp_data_unlock((struct sock *)msk);
 
 check_notify:
-- 
2.34.1
Technical Details
Message-ID: <20261008104840.131986-1-rameshkumar.t@phytecembedded.in>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342907-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342907-linux-kernel-netdev=dewy.ru
From: rameshsv06@gmail.com (T S Rameshkumar)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v3] mptcp: push queued data on passive TFO subflows becoming established
Date: Thu,  8 Oct 2026 16:18:40 +0530
Organization: Usenet Network
Message-ID: <20261008104840.131986-1-rameshkumar.t@phytecembedded.in>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="860345"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:x/2D/JwEc/WlwRsDrHnGwg+XdBA= sha256:szs1mxdSmbCnt/uZ5uGXsVv4Is8k7EF8+hMaYu8Z6JE=
	sha1:IOCSeDBS2F0yZ2x9jDYml3OeUOQ= sha256:sB7kaCdWeCsJ/liMtBZu2f2V5nRdg+kg/uj95hzUAgg=
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 1582C10F3A5; Thu,  8 Oct 2026 13:50:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=gmail.com
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 sxJOjJc-39ut;
	Thu,  8 Oct 2026 13:50:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342907-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 51FFF10F37D; Thu,  8 Oct 2026 13:50:02 +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 33240604969; Thu,  8 Oct 2026 10:50:01 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 013593914E4;
	Thu,  8 Oct 2026 10:49:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q6zLTMNO"
X-Received: from mail-dl1-f50.google.com (mail-dl1-f50.google.com [74.125.82.50])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D97F43EB7FB
	for <netdev@vger.kernel.org>; Thu,  8 Oct 2026 10:49:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.50
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791456598; cv=none; b=PqcPHNFxcc8TkYE6xNv2EIcEN6qLEA2TqqYvlITVBTnnbwgsMQH9n1DG9kgqFyX7N5sqVQDcS7bhYWdiBAv0Ej74qcF8joBqdXZxqNBcaW2dUW874LwJufOJvmrcjDnvbf0VYHJ1aiQKhn1S4E6W7b1ZnB7b/zCwwPbZWLEZl3M=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791456598; c=relaxed/simple;
	bh=ZVqPaMj9OBKmp7Fn9d0f7hf6S0qpLN+SZH0ehciTrYI=;
	h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=cenjHBFPVJm0vaQbxWbJfK4bUOlnYUNbpLCRXnkx9zV/WhxoO1SLJbCktJlXbj1r6zXFONSPvuFCbW4u61xySK7HDDQ9wQPZgtRPWRMcDMl5n6yUjmwB33lI5DJN9ViNcEvNoSmqroN8bvybpf874w5ptC5wd5eIXYIeHcDuFIQ=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q6zLTMNO; arc=none smtp.client-ip=74.125.82.50
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dl1-f50.google.com with SMTP id a92af1059eb24-15354aa70e8so1219414c88.1
        for <netdev@vger.kernel.org>; Thu, 08 Oct 2026 03:49:56 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1791456596; x=1792061396; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=JcYKjibBDVYYKXsTs/kEMk8DPe0X6aXUqJTngq/c/Sk=;
        b=Q6zLTMNO8bCKkznV/pcLT/3OfNDnvzk2krc/+HA8pGXKUKE1QzXETqtdZGfct0b4ig
         Ks4Ov3+UBM/4QTobwsplimwwILaRMSyPs9+JQJVk8mg81TzdAr+HqQasrh3OuQwTSSQ1
         hu10cVJY9Ob6pTHZxZQpHlPMZ1IjPsDomG7sMobME0dmeSm9wAok2DSwegKjsmcCSjK7
         BBevP0fp5dMj8/o5lWJN40BCwJXSzDAsdaPriTekTRqnduYiy8FzS4h6cbhUgyKJKPqp
         vr/lE2SAStbvyWSLADVP19I+bzcsnW2obCKpdw0h3xdnACEqi0H4ZkDOV+Czho6fthHx
         jJUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1791456596; x=1792061396;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=JcYKjibBDVYYKXsTs/kEMk8DPe0X6aXUqJTngq/c/Sk=;
        b=LHUnotYrLiC00idOoO23tqfWCO8qsF7AbsAIFCo/Ag30o2iRIsEWYrcovg1HX63U8p
         HJK/+0FeaZ750/ADcBXyo+BTHCshT2oae7WFHBje6qkTxYyvsH2YRupVXFkrMu/sfK5i
         hwz5Hb6V243a+jKEd3Hp8+M/wJBHPoA7/Ly30kiMGZHDHbK7v5FCdw8VeyQaDhbNs/38
         0IVsdz/jI22Md9WvF5B+FPut//nqPHxvcslAwoAgA7Q4QHrVNouyNCfN/0Xqh7lRz9KF
         HiuKnRfWBa12+Vwacl3sN+vstAR3g83GDVR9nQaWijspj5nVBBlQn7EthDDYjWORjl5+
         TPmQ==
X-Gm-Message-State: AFuF++k9mow0S6G9PEjdxyTVTct3rj6lyyTyD8UKfZjCiX6Ytn+TOO81
	9ViNWmL6hOFtVk5hDZmPro7mPualmmpCq9e9o42U0JluuYuEr1+f0bCv
X-Gm-Gg: AYBFou00ZwLNTcRH3bpBXizxdCOLKfVZMWNRCQvHNY2AkvF1Jxi2nTryBN8vMTTjWIW
	gt74YBcc/7ukHWOzsDlEnFw+SffxFQQSe7bxtizQR7y9vudMYSNnjjqQ9Gz4MPLyYHQr46Hvakc
	9+hvJNcqoJnzD1ztrO98LwuLeTOuH8q6gccuAMa4SWglxXcndgAfYVAr6R3JMajuvTz273BrGm6
	Wp/7l5iHlSTyragpLMeUV2DJkV6f2Ms0kRuNcm0AblFS7Hm3WrVsHvB7EFX3mSVCKt7rUbDsEqN
	0sAlRe9sXnm9z+LGs7ECg/Ze+l6pcWEM46hK5/NUHa/l90+qENvYCPAmN2G9I4jaT0GKo8dXiea
	JEgVqJsO+S4vkjxrcyMNrKyrTRO62SLjsA/CObDaTN0JbiqMDnpuJpj1/6iAVhjKQIAm3tVdvB1
	S7AWhuPde99xAhtPsFDRVk2NPJGXDFyn4QzpaprEZ3foGHe8t947qTbRJJLk/t9mQjCTOHN/BaB
	FFbwgv0
X-Received: by 2002:a05:7023:a8a:b0:14d:baf5:c40f with SMTP id a92af1059eb24-16205db7867mr7233939c88.14.1791456595585;
        Thu, 08 Oct 2026 03:49:55 -0700 (PDT)
X-Received: from ramesh.. ([124.123.89.203])
        by smtp.gmail.com with ESMTPSA id a92af1059eb24-1616b01c2b4sm12797756c88.20.2026.10.08.03.49.52
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 08 Oct 2026 03:49:55 -0700 (PDT)
X-Google-Original-From: T S Rameshkumar <rameshkumar.t@phytecembedded.in>
X-Cc: netdev@vger.kernel.org,
	mptcp@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	petar.sakic@ink.fish,
	T S Rameshkumar <rameshkumar.t@phytecembedded.in>
X-Mailer: git-send-email 2.34.1
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>