🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2298

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

#2298
From: netdev-bot+sashiko
Date: Mon, 12 Oct 2026 11:49
146 lines
11031 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The fix only covers passive TFO children whose SYN carried data.
- [Medium] If the passive TFO subflow's third ACK has no MP_CAPABLE
  option (for example a middlebox strips MPTCP options from non-SYN…
- [Low] The author and sign-off addresses do not match.

--

mptcp: push queued data on passive TFO subflows becoming established

This patch handles data that the server application writes while a
passive TFO subflow is still in SYN_RECV. When the MPC third ACK makes
the subflow fully established in check_fully_established(), the patch
calls __mptcp_check_push() under mptcp_data_lock() if subflow->is_mptfo
is set, and then clears is_mptfo.

Closes: https://lore.kernel.org/netdev/CAFPPu1gU2Y-D+d4i3F0MoNkYK+e1U+=X3qf6QycjfKBw+8snPg@mail.gmail.com/

> Signed-off-by: T S Rameshkumar <rameshkumar.t@phytecembedded.in>

[Severity: Low]
This isn't a bug, but the author address (rameshsv06@gmail.com) does not
match the only Signed-off-by address (rameshkumar.t@phytecembedded.in).
checkpatch.pl reports this as FROM_SIGN_OFF_MISMATCH.

Could the sign-off or the From: line be changed so they match?

> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index ce0de02f5a3a1..b865ee6afb00c 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);
> +	}

[Severity: High]
Does this cover passive TFO children created from a SYN that carried no
data?

Only mptcp_fastopen_subflow_synack_set_params() sets is_mptfo, and only
when SYN data is on the child's receive queue:

net/mptcp/fastopen.c:mptcp_fastopen_subflow_synack_set_params() {
    ...
	/* A valid TFO cookie does not guarantee SYN data. */
	skb = skb_peek(&ssk->sk_receive_queue);
	if (!skb)
		return;

	subflow->is_mptfo = 1;
    ...
}

tcp_try_fastopen() still creates a full TFO child in TCP_SYN_RECV from a
data-less SYN in two cases:

  - a SYN with a valid cookie and no payload
  - a cookie-request SYN when TFO_SERVER_COOKIE_NOT_REQD is set

The comment in tcp_try_fastopen() says:

	 * Note: Data-less SYN with valid cookie is allowed to
	 * send data in SYN_RECV state.

In both cases tcp_fastopen_add_skb() returns early on
end_seq == rcv_nxt. Nothing gets queued, so is_mptfo stays 0.

The msk is cloned in TCP_ESTABLISHED, so the server can accept() and
write right away. __mptcp_subflow_active() rejects the SYN_RECV ssk, so
the data stays at msk->first_pending.

When the pure MPC third ACK arrives, check_fully_established() reaches
set_fully_established but skips this push. mptcp_incoming_options() then
returns before ack_update_msk():

		if (!(mp_opt.suboptions & OPTION_MPTCP_DSS))
			return true;

Neither subflow_state_change() nor mptcp_pm_fully_established() pushes
the msk write queue. No rtx timer is armed either, because nothing was
ever sent.

Wouldn't a server-speaks-first protocol still stall in this case? That
is the same symptom the commit message describes.

Would it work better to trigger the push when a passive MPC subflow
becomes fully established while msk->first_pending is set, rather than
on is_mptfo?

[Severity: Medium]
What happens if the third ACK on a passive TFO subflow with SYN data has
no MP_CAPABLE option? That can happen if a middlebox strips MPTCP
options from non-SYN segments, or if the peer leaves them out.

The SYN payload advanced ssn_offset, so the third ACK has
seq == ssn_offset + 1 and skips the out-of-order branch. Without DSS or
ADD_ADDR, it then takes the fallback branch earlier in
check_fully_established():

	if (!(mp_opt->suboptions & OPTIONS_MPTCP_MPC)) {
		if (subflow->mp_join)
			goto reset;
		subflow->mp_capable = 0;
		if (!mptcp_try_fallback(ssk, MPTCP_MIB_MPCAPABLEDATAFALLBACK)) {
			...
		}
		return false;
	}

That branch returns before set_fully_established, so the new push never
runs. mptcp_incoming_options() then returns without pushing:

	if (!check_fully_established(msk, sk, subflow, skb, &mp_opt))
		return sk->sk_state != TCP_CLOSE;

tcp_data_snd_check() finds the ssk write queue empty, because the data
is still in the msk write queue. __mptcp_check_push() only runs on the
next incoming segment, through the __mptcp_check_fallback() branch at
the top of mptcp_incoming_options().

If the client is waiting for the server's reply to its TFO request,
could the data written in SYN_RECV stay stuck in this fallback case too?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261008104840.131986-1-rameshkumar.t%40phytecembedded.in
Technical Details
Message-ID: <179180578699.434549.17104698101547866638@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344939-linux-kernel-netdev=dewy.ru
References: <20261008104840.131986-1-rameshkumar.t@phytecembedded.in>

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-344939-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v3] mptcp: push queued data on passive TFO subflows
 becoming established
Date: Mon, 12 Oct 2026 11:49:46 +0000
Organization: Usenet Network
Message-ID: <179180578699.434549.17104698101547866638@kernel.org>
References: <20261008104840.131986-1-rameshkumar.t@phytecembedded.in>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1766883"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:D5i5KHsJ6TZPDEtxMztgOvZZIJI= sha256:NTM8lMcupSCIfJVrhPLEkbUL3+J2qR9/bs0zfXexmzw=
	sha1:23t07yUWVsBQ8e/sAbLNZDIRI0o= sha256:07m9M+aGjbLPGSZKWq+yEb4UJQ4zL5E2UQS+RXciQcg=
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 2001910FBBB; Mon, 12 Oct 2026 15:05:24 +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.241, 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, URIBL_BLOCKED=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 5802xbddR0Is;
	Mon, 12 Oct 2026 15:05: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-344939-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 0AABA10FB9D; Mon, 12 Oct 2026 15:05: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 649F5612228; Mon, 12 Oct 2026 11:53:18 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 55CC846AECF;
	Mon, 12 Oct 2026 11:49:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kXmx+Frb"
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 561D44766B1;
	Mon, 12 Oct 2026 11:49:48 +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=1791805791; cv=none; b=aRoBXpZKQPTfkDD7wYsE5nuYE5zFTLIFHz0DZOqQYkS39jHh3K/QRWKpcLuwRRsVbLwPj48oxxdSCd1np3REAUFtZhBI7oy/h5gmPDcznfzPpLDtMw8Uorer43FbyVCxF0+/1c0u4JnPPWEZaxQUNUCfm22wxS6Z2P8rwYHVwRs=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791805791; c=relaxed/simple;
	bh=eEGHR1mGzXV2D56jleqiwMUkHuS2xYotBOpfGB3XqRI=;
	h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References:
	 Content-Type:MIME-Version; b=F50CmbVwv/KDJHWRYr/0/NpYVdiepKwKxbo1qfqIxruBFGNA01MvFDeVY3pITgCFsiu7F9hW4gdaB91Nh8xlbQEXP7YxmFLirc8N5BsSaHxPPRp4SUNaVvBWSFoQP3sNO9pCvCgKdlrVt9nDfH5GEj6vmeqH37wFo2Z5HaoseWc=
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=kXmx+Frb; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7931E1F0089B;
	Mon, 12 Oct 2026 11:49:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791805788;
	bh=PaRI2t53VPJ+0vnPAZfKfUr2oOawUBTdE9uZt78o1Uc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=kXmx+FrbPvCsEW2vEl21Q/yVnEthdkJSytQmPizNFEsodSCilD0W/WvMklCWfIwUY
	 GDpsGQC7cxBmotApKOmze5p9lwyEoPeeahfNhKXGu0jEPib35XcDC+rmuHb9PzH78O
	 aoCFLjU2I0rA9OUGi0kXD+BM/VhT5AFmsmlPZXdfNaxC6DcNQrzwwLYJEIhpjS03Eg
	 SvtrvUuh05md8ltiTsK3NgurxraDY1njvesDM90QQ4jYMg+Tj3OXtOi11FAksJU1+Z
	 M2l2Wsq+XliKD95SiU/tlfBnLUAPA/RgEyio7RY+Zey3FdekkPcZGtTOgI4Db436GH
	 lwWrgJlVsLMyw==
X-Cc: matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org,
 netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org,
 petar.sakic@ink.fish, rameshkumar.t@phytecembedded.in, kuba@kernel.org
X-In-Reply-To: <20261008104840.131986-1-rameshkumar.t@phytecembedded.in>
X-sashiko-severity: High
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>