๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by "Matthieu Baerts (NGI0)" Mon, 16 Nov 2026 22:06
[PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake
#17471
Author: "Matthieu Baerts (NGI0)"
Date: Mon, 16 Nov 2026 22:06
69 lines
11484 bytes
With TCP Fast Open, the data written by an MPTCP server before the 3rd
ACK is not sent when this ACK arrives without MPTCP options, but only
when another event triggers a push, e.g. new data from the peer.

The previous commit pushes this data when the third ACK, with the
MP_CAPABLE option, makes a passive TFO subflow fully established. If
this ACK has no MPTCP options, e.g. because a middlebox removed them,
check_fully_established() falls back to TCP, and returns before this
push. The fallback case of mptcp_incoming_options(), which pushes the
pending data, is only reached with the next packets.

The fix used here is to push the pending data after this fallback too.
Not only for the passive TFO subflows: data can also be pending on the
client side, when the first ACK from the server has no MPTCP options,
e.g. if the window announced by the SYN+ACK was too small for it. Same
here, this data was then only sent when another event triggered a push.

This issue has been found by an AI code review agent (Clashiko), while
reviewing an earlier version of the previous commit. It has been
reproduced with a new Packetdrill test, where the MPTCP options are
removed from the third ACK. Without this patch, and before the earlier
commit "mptcp: arm the rtx timer if a push leaves data behind", this
data was not sent:

  server-tfo-fallback-write-before-3rd-ack.pkt:26: error handling packet: Timed out waiting for packet

Since this earlier commit, this data is sent, but only when the MPTCP
retransmission timer fires, here after one second, as the test increases
its interval:

  server-tfo-fallback-write-before-3rd-ack.pkt:26: error handling packet: timing error: expected outbound packet at 0.235869 sec but happened at 1.144189 sec; tolerance 0.100000 sec

The client side case has been reported by Sashiko, while reviewing an
earlier version of this commit, and confirmed with another new
Packetdrill test, where the client writes more data than the window of
the SYN+ACK, before an ACK without MPTCP options. Without this patch:

  v1_connect_fallback_pending_data.pkt:30: error handling packet: timing error: expected outbound packet at 0.251394 sec but happened at 1.195904 sec; tolerance 0.100000 sec

Two Fixes tags: the passive TFO case comes from the first commit, and
the client side one from the second one.

Fixes: 36b122baf6a8 ("mptcp: add subflow_v(4,6)_send_synack()")
Fixes: 6f8a612a33e4 ("mptcp: keep track of advertised windows right edge")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/options.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index bcf3440d1901..617358ff7f99 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1035,6 +1035,10 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 			MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_FALLBACKFAILED);
 			goto reset;
 		}
+		/* this ACK will not reach the fallback path: push from here */
+		mptcp_data_lock(sk);
+		__mptcp_check_push(sk, ssk);
+		mptcp_data_unlock(sk);
 		return false;
 	}
 

-- 
2.55.0
Re: [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake
#18161
Author: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 22:29
92 lines
11420 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] check_fully_established() (net/mptcp/options.c) now pushes
  pending MPTCP data in its fallback branch every time that branch runs,โ€ฆ

--

mptcp: push queued data on subflows falling back at the handshake

This commit pushes pending MPTCP data from check_fully_established() when
a subflow that is not yet fully established falls back to TCP, because
the first established packet carries no MP_CAPABLE option. This covers
both passive TFO subflows and clients with data held back by a small
SYN+ACK window.

> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index bcf3440d1901b..617358ff7f990 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -1035,6 +1035,10 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
>  			MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_FALLBACKFAILED);
>  			goto reset;
>  		}
> +		/* this ACK will not reach the fallback path: push from here */
> +		mptcp_data_lock(sk);
> +		__mptcp_check_push(sk, ssk);
> +		mptcp_data_unlock(sk);
>  		return false;
>  	}

[Severity: Low]
Can this push also run while an incoming RST is being processed?

tcp_reset() calls into MPTCP before it tears the subflow down:

net/ipv4/tcp_input.c:tcp_reset() {
    ...
	if (sk_is_mptcp(sk))
		mptcp_incoming_options(sk, skb);
    ...
	tcp_done_with_error(sk, err);
}

Take an active client whose mp_capable subflow has sent the third ACK but
has not yet received a DSS DATA_ACK, so subflow->fully_established is
still 0. Suppose an RST arrives with seq == rcv_nxt == ssn_offset + 1.
tcp_validate_incoming() accepts it and calls tcp_reset().

A plain RST from a middlebox, or an RST that only carries MP_RST, has no
OPTIONS_MPTCP_MPC. So check_fully_established() enters this fallback
branch, and mptcp_try_fallback() succeeds.

The new code then goes through:

__mptcp_check_push()
  __mptcp_subflow_push_pending()
    mptcp_sched_get_send()
    __subflow_push_pending()
      tcp_push()
    mptcp_reset_rtx_timer()

In fallback mode, mptcp_sched_get_send() only checks
__tcp_can_send(msk->first) and sk_stream_memory_free(). The subflow is
still TCP_ESTABLISHED at this point, so it gets picked.

Right after this returns, tcp_done_with_error() purges the subflow write
queue and closes the subflow.

Usually TCP's own snd_wnd keeps the data off the wire. The work is still
wasted, though: dfrags are copied into a queue that is purged at once,
msk->snd_nxt moves forward, and the msk rtx timer is armed during
teardown.

What if the TCP window allows more than the msk window? For example,
data could have been left behind by an allocation failure, or snd_wnd
could have been updated by a segment without a DSS. Could data segments
then go on the wire after a valid RST was accepted?

The fallback block at the top of mptcp_incoming_options() already does
this for an msk that fell back earlier. This patch makes the same thing
reachable from the not-yet-fully-established case.

The comment says "this ACK", but the packet here can be an RST. Would it
make sense to skip the push when the skb has the RST flag set?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e%40kernel.org
Re: [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake
#18773
Author: Matthieu Baerts
Date: Wed, 18 Nov 2026 22:02
25 lines
12032 bytes
Hello,

On 17/11/2026 23:29, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
> 
> Low priority / nit picks for your consideration:

(...)

> [Severity: Low]
> Can this push also run while an incoming RST is being processed?

This is not new: the fallback block at the top of mptcp_incoming_options
already does the same push, RST or not. At worst, data is queued then
purged, or sent within the TCP window just before the reset, and the
peer replies with a reset. This is harmless. If really needed (I don't
think so) a follow-up patch can be sent, but to -next I suppose.

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

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads