Netdev List
 help / color / mirror / Atom feed
* [PATCH mptcp_net-next 1/1] mptcp: fastopen: only mark MPTFO subflows with SYN data
       [not found] <cover.1780458440.git.bronzed_45_vested@icloud.com>
@ 2026-06-06  6:28 ` Ren Wei
  2026-07-22 11:07   ` Matthieu Baerts (NGI0)
  0 siblings, 1 reply; 5+ messages in thread
From: Ren Wei @ 2026-06-06  6:28 UTC (permalink / raw)
  To: netdev, mptcp
  Cc: matttbe, martineau, geliang, pabeni, kuba, dmytro, yuantan098,
	yifanwucs, tomapufckgml, zcliangcn, bird, bronzed_45_vested,
	n05ec

From: Wyatt Feng <bronzed_45_vested@icloud.com>

Passive TCP Fast Open accepts a valid-cookie SYN even when it carries
no data. In that case the child socket's receive queue is intentionally
left empty.

mptcp_fastopen_subflow_synack_set_params() set is_mptfo before checking
for queued SYN data. That made data-less TFO SYNs hit a WARN and, if
the warning was non-fatal, left stale MPTFO state behind. The stale
flag could later trigger a state-confusion bug in
check_fully_established().

Only mark the subflow as MPTFO after confirming that a SYN-data skb is
present. Return quietly when the receive queue is empty.

Fixes: 36b122baf6a8 ("mptcp: add subflow_v(4,6)_send_synack()")
Cc: stable@vger.kernel.org
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Assisted-by: Codex:GPT-5.4
Signed-off-by: Wyatt Feng <bronzed_45_vested@icloud.com>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
---
 net/mptcp/fastopen.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/fastopen.c b/net/mptcp/fastopen.c
index 082c46c0f50e..f717750906ff 100644
--- a/net/mptcp/fastopen.c
+++ b/net/mptcp/fastopen.c
@@ -24,12 +24,13 @@ void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subf
 	sk = subflow->conn;
 	tp = tcp_sk(ssk);
 
-	subflow->is_mptfo = 1;
-
+	/* A valid TFO cookie does not guarantee SYN data. */
 	skb = skb_peek(&ssk->sk_receive_queue);
-	if (WARN_ON_ONCE(!skb))
+	if (!skb)
 		return;
 
+	subflow->is_mptfo = 1;
+
 	/* dequeue the skb from sk receive queue */
 	__skb_unlink(skb, &ssk->sk_receive_queue);
 	skb_ext_reset(skb);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp_net-next 1/1] mptcp: fastopen: only mark MPTFO subflows with SYN data
  2026-06-06  6:28 ` [PATCH mptcp_net-next 1/1] mptcp: fastopen: only mark MPTFO subflows with SYN data Ren Wei
@ 2026-07-22 11:07   ` Matthieu Baerts (NGI0)
  2026-07-22 11:31     ` Yuan Tan
  2026-07-22 14:22     ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-07-22 11:07 UTC (permalink / raw)
  To: Ren Wei
  Cc: netdev, mptcp, matttbe, martineau, geliang, pabeni, kuba, dmytro,
	yuantan098, yifanwucs, tomapufckgml, zcliangcn, bird,
	bronzed_45_vested

Hi Ren, Wyatt, Yuan,

> Passive TCP Fast Open accepts a valid-cookie SYN even when it carries
> no data. In that case the child socket's receive queue is intentionally
> left empty.
>
> mptcp_fastopen_subflow_synack_set_params() set is_mptfo before checking
> for queued SYN data. That made data-less TFO SYNs hit a WARN and, if
> the warning was non-fatal, left stale MPTFO state behind. The stale
> flag could later trigger a state-confusion bug in
> check_fully_established().
>
> Only mark the subflow as MPTFO after confirming that a SYN-data skb is
> present. Return quietly when the receive queue is empty.

Thank you for the fix, it looks good to me:

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

@Netdev maintainers: this can be applied directly in net.


Sorry for the delay, I initially wanted to understand the reproducer,
then wrote a small packetdrill script, then I lost track of this patch.

As I mentioned to Yuan last week at NetdevConf, it would be great if the
PoC could first try to use Packetdrill when it is doable. For example,
in this case, this packetdrill script appears to be far more readable
than the .c files generated by AI:

  https://github.com/multipath-tcp/packetdrill/pull/202/changes

=> It is easy to read the syscalls, the injected packets (<) and the
expected ones (>) with an output similar to the one from tcpdump.

Note that for MPTCP, this fork should be used:

  https://github.com/multipath-tcp/packetdrill

Otherwise, the official repo can be used:

  https://github.com/google/packetdrill

-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp_net-next 1/1] mptcp: fastopen: only mark MPTFO subflows with SYN data
  2026-07-22 11:07   ` Matthieu Baerts (NGI0)
@ 2026-07-22 11:31     ` Yuan Tan
  2026-07-22 14:22     ` Jakub Kicinski
  1 sibling, 0 replies; 5+ messages in thread
From: Yuan Tan @ 2026-07-22 11:31 UTC (permalink / raw)
  To: Matthieu Baerts (NGI0)
  Cc: Ren Wei, netdev, mptcp, martineau, geliang, pabeni, kuba, dmytro,
	yifanwucs, tomapufckgml, zcliangcn, bird, bronzed_45_vested

On Wed, Jul 22, 2026 at 4:07 AM Matthieu Baerts (NGI0)
<matttbe@kernel.org> wrote:
>
> Hi Ren, Wyatt, Yuan,
>
> > Passive TCP Fast Open accepts a valid-cookie SYN even when it carries
> > no data. In that case the child socket's receive queue is intentionally
> > left empty.
> >
> > mptcp_fastopen_subflow_synack_set_params() set is_mptfo before checking
> > for queued SYN data. That made data-less TFO SYNs hit a WARN and, if
> > the warning was non-fatal, left stale MPTFO state behind. The stale
> > flag could later trigger a state-confusion bug in
> > check_fully_established().
> >
> > Only mark the subflow as MPTFO after confirming that a SYN-data skb is
> > present. Return quietly when the receive queue is empty.
>
> Thank you for the fix, it looks good to me:
>
> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>
> @Netdev maintainers: this can be applied directly in net.
>
>
> Sorry for the delay, I initially wanted to understand the reproducer,
> then wrote a small packetdrill script, then I lost track of this patch.
>
> As I mentioned to Yuan last week at NetdevConf, it would be great if the
> PoC could first try to use Packetdrill when it is doable. For example,
> in this case, this packetdrill script appears to be far more readable
> than the .c files generated by AI:
>
>   https://github.com/multipath-tcp/packetdrill/pull/202/changes
>
> => It is easy to read the syscalls, the injected packets (<) and the
> expected ones (>) with an output similar to the one from tcpdump.
>
> Note that for MPTCP, this fork should be used:
>
>   https://github.com/multipath-tcp/packetdrill
>
> Otherwise, the official repo can be used:
>
>   https://github.com/google/packetdrill
>
> --
> Matthieu Baerts (NGI0) <matttbe@kernel.org>

Thank you very much for your review. After receiving your suggestions,
I asked Wyatt to prepare a packetdrill version of the PoC for this
bug, but it is not ready yet. I apologize for taking up some of your
time on this review.

For future patches, whenever possible, we will include a packetdrill
PoC in the cover letter and send it to the public mailing list. We
will also use a new Reported-by: Vega tag instead of the tag we are
currently using.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp_net-next 1/1] mptcp: fastopen: only mark MPTFO subflows with SYN data
  2026-07-22 11:07   ` Matthieu Baerts (NGI0)
  2026-07-22 11:31     ` Yuan Tan
@ 2026-07-22 14:22     ` Jakub Kicinski
  2026-07-22 14:25       ` Matthieu Baerts
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2026-07-22 14:22 UTC (permalink / raw)
  To: Matthieu Baerts (NGI0)
  Cc: Ren Wei, netdev, mptcp, martineau, geliang, pabeni, dmytro,
	yuantan098, yifanwucs, tomapufckgml, zcliangcn, bird,
	bronzed_45_vested

On Wed, 22 Jul 2026 13:07:42 +0200 Matthieu Baerts (NGI0) wrote:
> @Netdev maintainers: this can be applied directly in net.

Too late, please take it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp_net-next 1/1] mptcp: fastopen: only mark MPTFO subflows with SYN data
  2026-07-22 14:22     ` Jakub Kicinski
@ 2026-07-22 14:25       ` Matthieu Baerts
  0 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2026-07-22 14:25 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Ren Wei, netdev, mptcp, martineau, geliang, pabeni, dmytro,
	yuantan098, yifanwucs, tomapufckgml, zcliangcn, bird,
	bronzed_45_vested

On 22/07/2026 16:22, Jakub Kicinski wrote:
> On Wed, 22 Jul 2026 13:07:42 +0200 Matthieu Baerts (NGI0) wrote:
>> @Netdev maintainers: this can be applied directly in net.
> 
> Too late, please take it.

No problem, I did take it, and I will send it with the next batch.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-22 14:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1780458440.git.bronzed_45_vested@icloud.com>
2026-06-06  6:28 ` [PATCH mptcp_net-next 1/1] mptcp: fastopen: only mark MPTFO subflows with SYN data Ren Wei
2026-07-22 11:07   ` Matthieu Baerts (NGI0)
2026-07-22 11:31     ` Yuan Tan
2026-07-22 14:22     ` Jakub Kicinski
2026-07-22 14:25       ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox