Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4
@ 2026-11-16 22:06 Matthieu Baerts (NGI0)
  2026-11-16 22:06 ` [PATCH net 1/7] mptcp: do not use a raised snd_wnd for the send window Matthieu Baerts (NGI0)
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable,
	Quanye Yang, Petar Sakic, T S Rameshkumar, Chris Mason,
	Geliang Tang

Here are some unrelated fixes:

- Patch 1: do not send data beyond the window announced by the peer. A
  fix for v5.11.

- Patch 2: push pending data after a sendmsg copy fault. A fix for v6.1.

- Patches 3-6: with TFO, send the data written by a server before the
  third ACK as soon as this ACK arrives, also in case of fallback to
  TCP, even if the connection was shut down. Fixes for v6.2 and v5.19.

- Patch 7: after a fallback, fix the dummy mapping of overlapping
  segments. A fix for v6.19.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Geliang Tang (1):
      mptcp: fix dummy mapping of overlapping segments

Matthieu Baerts (NGI0) (5):
      mptcp: do not use a raised snd_wnd for the send window
      mptcp: use sk instead of casting msk in check_fully_established()
      mptcp: push queued data on passive TFO subflows becoming established
      mptcp: push queued data on subflows falling back at the handshake
      mptcp: don't send a FIN before the pending data on fallback

Quanye Yang (1):
      mptcp: push pending data after a sendmsg copy fault

 net/mptcp/options.c  | 23 +++++++++++++++++++----
 net/mptcp/protocol.c |  4 +++-
 net/mptcp/protocol.h |  6 +++++-
 net/mptcp/subflow.c  |  2 +-
 4 files changed, 28 insertions(+), 7 deletions(-)
---
base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git main
change-id: 20261116-net-mptcp-misc-fixes-7-4-rc4-9dc946f31d92

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


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

* [PATCH net 1/7] mptcp: do not use a raised snd_wnd for the send window
  2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
@ 2026-11-16 22:06 ` Matthieu Baerts (NGI0)
  2026-11-16 22:06 ` [PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault Matthieu Baerts (NGI0)
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable

ack_update_msk() sets the right edge of the MPTCP send window from the
DATA_ACK and tcp_sk(ssk)->snd_wnd, but this is not always what the peer
announced: mptcp_check_allowed_size() raises it to
window_end - data_seq, so that TCP lets through what the MPTCP-level
window allows.

That is fine for new data. For data sent again, data_seq can be below
snd_una, and snd_wnd ends up too large by the difference. TCP only
overwrites it when an ACK moves things forward on this subflow, see
tcp_may_update_window(). If a DATA_ACK moved by another subflow comes in
on this subflow before that, wnd_end goes past what the peer offered. It
only moves forward, so it stays there.

The sender then transmits data beyond the peer's window: the peer drops
it (MPTCP_MIB_NODSSWINDOW) after TCP acked it, and only an MPTCP-level
retransmission can recover it, which raises snd_wnd again. The
connection can then stay stuck at a low rate for several seconds, with
nothing in flight on any subflow.

This raise has been added by commit b713d0067574 ("mptcp: really share
subflow snd_wnd"), but snd_wnd could already be too large before: when
nothing moves at the TCP level, tcp_may_update_window() ignores a lower
non-zero window, while the peer can announce one with a DATA_ACK that
moved, keeping the same right edge.

Use the window announced in the packet carrying the DATA_ACK instead.

In my case with BBR, a small TCP rmem, and a second path with a much
higher latency, a lower throughput and some losses, this small change
can double the throughput in the worst cases.

The issue has been reproduced with a new Packetdrill test, on a single
subflow: the data is acked by TCP, then by MPTCP with a lower window,
keeping the same right edge. Without this patch, the 2000 bytes written
next were sent, instead of the 1280 bytes up to this right edge:

  dss_dack_window_server.pkt:23: error handling packet: live packet payload: expected 1280 bytes vs actual 2000 bytes

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 | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 02e785a14b8a..a1e65309171e 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1120,9 +1120,11 @@ static void rwin_update(struct mptcp_sock *msk, struct sock *ssk,
 
 static void ack_update_msk(struct mptcp_sock *msk,
 			   struct sock *ssk,
+			   const struct sk_buff *skb,
 			   struct mptcp_options_received *mp_opt)
 {
 	u64 new_wnd_end, new_snd_una, old_snd_una;
+	u32 win = ntohs(tcp_hdr(skb)->window);
 	struct sock *sk = (struct sock *)msk;
 	u64 snd_nxt;
 
@@ -1143,7 +1145,12 @@ static void ack_update_msk(struct mptcp_sock *msk,
 		     after64(new_snd_una, snd_nxt)))
 		new_snd_una = old_snd_una;
 
-	new_wnd_end = new_snd_una + tcp_sk(ssk)->snd_wnd;
+	/* What the peer announced: tcp_sk(ssk)->snd_wnd can be larger, see
+	 * mptcp_check_allowed_size(), and is not always updated.
+	 */
+	if (likely(!tcp_hdr(skb)->syn))
+		win <<= tcp_sk(ssk)->rx_opt.snd_wscale;
+	new_wnd_end = new_snd_una + win;
 
 	if (after64(new_wnd_end, msk->wnd_end))
 		WRITE_ONCE(msk->wnd_end, new_wnd_end);
@@ -1313,7 +1320,7 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
 	 * monodirectional flows will stuck
 	 */
 	if (mp_opt.use_ack)
-		ack_update_msk(msk, sk, &mp_opt);
+		ack_update_msk(msk, sk, skb, &mp_opt);
 	rwin_update(msk, sk, skb);
 
 	/* Zero-data-length packets are dropped by the caller and not

-- 
2.55.0


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

* [PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault
  2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
  2026-11-16 22:06 ` [PATCH net 1/7] mptcp: do not use a raised snd_wnd for the send window Matthieu Baerts (NGI0)
@ 2026-11-16 22:06 ` Matthieu Baerts (NGI0)
  2026-11-17 22:29   ` netdev-bot+sashiko
  2026-11-16 22:06 ` [PATCH net 3/7] mptcp: use sk instead of casting msk in check_fully_established() Matthieu Baerts (NGI0)
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), Quanye Yang,
	stable

From: Quanye Yang <quanyeyang@proton.me>

mptcp_sendmsg() copies into the msk write queue first, then
__mptcp_push_pending() on the success path. tcp_sendmsg_locked()
does the opposite: its do_error path jumps to out, and out
calls tcp_push() when copied > 0.

A later iovec fault (copy_from_iter / -EFAULT) after a successful
iteration therefore returns the partial byte count but leaves the
already-queued dfrag on rtx_queue. No subflow packet is sent, no
retransmission timer is armed, and DATA_FIN stays blocked on
first_pending.

Push in do_error when copied is already non-zero. Do not move
the push to out: copied is a size_t, and sk_stream_error()
stores a negative errno there.

The issue was spot by Sashiko, but easy to reproduce with Packetdrill:

  writev(4, [{..., 32728}, {NULL, 4096}], 2) = 32728

Fixes: 69800e516e96 ("mptcp: propagate fastclose error")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/640
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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8968db58083e..b67096ee131b 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2130,8 +2130,10 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 	return copied;
 
 do_error:
-	if (copied)
+	if (copied) {
+		__mptcp_push_pending(sk, msg->msg_flags);
 		goto out;
+	}
 
 	copied = sk_stream_error(sk, msg->msg_flags, ret);
 	goto out;

-- 
2.55.0


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

* [PATCH net 3/7] mptcp: use sk instead of casting msk in check_fully_established()
  2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
  2026-11-16 22:06 ` [PATCH net 1/7] mptcp: do not use a raised snd_wnd for the send window Matthieu Baerts (NGI0)
  2026-11-16 22:06 ` [PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault Matthieu Baerts (NGI0)
@ 2026-11-16 22:06 ` Matthieu Baerts (NGI0)
  2026-11-16 22:06 ` [PATCH net 4/7] mptcp: push queued data on passive TFO subflows becoming established Matthieu Baerts (NGI0)
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable

The MPTCP socket is cast to a struct sock in check_fully_established(),
to take its data lock. The next commits need it more, to push the
pending data.

Add a local 'sk' variable instead of casting msk each time: no
functional change.

The 'Fixes' tag here below is the same as the one from the next
commits: this patch is needed to fix the issues introduced by this
commit ID.

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

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index a1e65309171e..1c58468b985b 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -982,6 +982,8 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 				    struct sk_buff *skb,
 				    struct mptcp_options_received *mp_opt)
 {
+	struct sock *sk = (struct sock *)msk;
+
 	/* here we can process OoO, in-window pkts, only in-sequence 4th ack
 	 * will make the subflow fully established
 	 */
@@ -1043,9 +1045,9 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 	if (mp_opt->deny_join_id0)
 		WRITE_ONCE(msk->pm.remote_deny_join_id0, true);
 
-	mptcp_data_lock((struct sock *)msk);
+	mptcp_data_lock(sk);
 	__mptcp_subflow_fully_established(msk, subflow, mp_opt);
-	mptcp_data_unlock((struct sock *)msk);
+	mptcp_data_unlock(sk);
 
 check_notify:
 	/* if the subflow is not already linked into the conn_list, we can't

-- 
2.55.0


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

* [PATCH net 4/7] mptcp: push queued data on passive TFO subflows becoming established
  2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
                   ` (2 preceding siblings ...)
  2026-11-16 22:06 ` [PATCH net 3/7] mptcp: use sk instead of casting msk in check_fully_established() Matthieu Baerts (NGI0)
@ 2026-11-16 22:06 ` Matthieu Baerts (NGI0)
  2026-11-17 22:29   ` netdev-bot+sashiko
  2026-11-16 22:06 ` [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake Matthieu Baerts (NGI0)
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable,
	Petar Sakic, T S Rameshkumar

With TCP Fast Open, the data written by an MPTCP server before the 3rd
ACK is not sent when this ACK arrives, but only when another event
triggers a push, e.g. new data from the peer. With a request/response
protocol, the client waits for the reply, which can then stay stuck.

A SYN with a valid TFO cookie creates a child socket right away, which
can be accepted while its subflow is still in the SYN_RECV state. The
MPTCP socket is already in the ESTABLISHED state: send() puts the data
in its write queue, but this data cannot be pushed to the subflow before
it is established, see __mptcp_subflow_active(). When the third ACK,
with the MP_CAPABLE option, arrives, check_fully_established() marks
the subflow as fully established, but nothing pushes the pending data:
this ACK has no DSS option, so ack_update_msk() is not called.

The fix used here is to push the pending data when a passive TFO subflow
becomes fully established. Checking subflow->is_mptfo is not enough:
since commit e00b63056fb4 ("mptcp: fastopen: only mark MPTFO subflows
with SYN data"), it is not set when the SYN has no data, while a child
is also created in this case. syn_fastopen_child is then used instead.

This issue has been reported by a user of proxies over MPTCP: the
clients put their requests in the SYN, and the replies from the targets
close to the server were stuck. It has been reproduced with new
Packetdrill tests, where the server writes data before the third ACK,
after a SYN with and without data. 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-write-before-3rd-ack.pkt:24: 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 tests increase
its interval:

  server-tfo-write-before-3rd-ack.pkt:24: error handling packet: timing error: expected outbound packet at 0.237174 sec but happened at 1.181857 sec; tolerance 0.100000 sec

Fixes: 36b122baf6a8 ("mptcp: add subflow_v(4,6)_send_synack()")
Cc: stable@vger.kernel.org
Suggested-by: Petar Sakic <petar.sakic@ink.fish>
Suggested-by: T S Rameshkumar <rameshkumar.t@phytecembedded.in>
Reported-by: Petar Sakic <petar.sakic@ink.fish>
Closes: https://lore.kernel.org/mptcp/CAFPPu1gU2Y-D+d4i3F0MoNkYK+e1U+=X3qf6QycjfKBw+8snPg@mail.gmail.com/
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/options.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 1c58468b985b..bcf3440d1901 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1047,6 +1047,8 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 
 	mptcp_data_lock(sk);
 	__mptcp_subflow_fully_established(msk, subflow, mp_opt);
+	if (tcp_sk(ssk)->syn_fastopen_child)
+		__mptcp_check_push(sk, ssk);
 	mptcp_data_unlock(sk);
 
 check_notify:

-- 
2.55.0


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

* [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake
  2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
                   ` (3 preceding siblings ...)
  2026-11-16 22:06 ` [PATCH net 4/7] mptcp: push queued data on passive TFO subflows becoming established Matthieu Baerts (NGI0)
@ 2026-11-16 22:06 ` Matthieu Baerts (NGI0)
  2026-11-17 22:29   ` netdev-bot+sashiko
  2026-11-16 22:06 ` [PATCH net 6/7] mptcp: don't send a FIN before the pending data on fallback Matthieu Baerts (NGI0)
  2026-11-16 22:06 ` [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments Matthieu Baerts (NGI0)
  6 siblings, 1 reply; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable

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


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

* [PATCH net 6/7] mptcp: don't send a FIN before the pending data on fallback
  2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
                   ` (4 preceding siblings ...)
  2026-11-16 22:06 ` [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake Matthieu Baerts (NGI0)
@ 2026-11-16 22:06 ` Matthieu Baerts (NGI0)
  2026-11-17 22:29   ` netdev-bot+sashiko
  2026-11-16 22:06 ` [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments Matthieu Baerts (NGI0)
  6 siblings, 1 reply; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable

When an MPTCP connection falls back to TCP after having been shut down,
the data that is still in the write queue of the MPTCP socket is lost:
a FIN is sent at fallback time, and this data cannot be sent after it.
This can happen with TCP Fast Open (TFO), when a server writes data and
shuts the connection down before the third ACK, and this ACK has no
MPTCP options.

When the MPTCP socket has been shut down, mptcp_try_fallback() also
shuts the subflow down: if the DATA_FIN had already been sent, nothing
would send a FIN on this subflow otherwise. The commit introducing this
only considered the case where all the data had already been pushed to
the subflow.

The fix used here is to only shut the subflow down at fallback time if
no new data is pending, i.e. if all the data before the DATA_FIN has
already been sent. Otherwise, mptcp_check_send_data_fin() will do it
once this data has been pushed, e.g. by the previous commit. Pending
data that has been reinjected, e.g. after the failure of another
subflow, is not new: it is already in this subflow.

This issue has been found by an AI code review agent, while reviewing
the code of the previous commit, and confirmed with a new Packetdrill
test, where the server writes data and shuts the connection down before
the third ACK, from which the MPTCP options are removed. Without this
patch, a FIN was sent right after this ACK, and the data was never
sent:

  inbound injected packet:  0.240127 . 501:501(0) ack 4103187975 win 450
  outbound sniffed packet:  0.240207 F. 4103187975:4103187975(0) ack 501 win 1050
  outbound sniffed packet:  1.347800 F. 4103187975:4103187975(0) ack 501 win 1050
  outbound sniffed packet:  2.499829 F. 4103187975:4103187975(0) ack 501 win 1050
  outbound sniffed packet:  4.739843 F. 4103187975:4103187975(0) ack 501 win 1050
  server-tfo-fallback-shutdown-before-3rd-ack.pkt:27: error handling packet: Timed out waiting for packet

Fixes: d51991e2e314 ("mptcp: fix shutdown vs fallback race")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/protocol.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 011e73d04ee6..7d226ee38315 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1333,7 +1333,11 @@ static inline bool mptcp_try_fallback(struct sock *ssk, int fb_mib)
 	msk = mptcp_sk(sk);
 	if (!__mptcp_try_fallback(msk, fb_mib))
 		return false;
-	if (READ_ONCE(msk->snd_data_fin_enable) && !(ssk->sk_shutdown & SEND_SHUTDOWN)) {
+
+	/* no FIN before new data: see mptcp_check_send_data_fin() */
+	if (READ_ONCE(msk->snd_data_fin_enable) &&
+	    !before64(READ_ONCE(msk->snd_nxt) + 1, READ_ONCE(msk->write_seq)) &&
+	    !(ssk->sk_shutdown & SEND_SHUTDOWN)) {
 		gfp_t saved_allocation = ssk->sk_allocation;
 
 		/* we are in a atomic (BH) scope, override ssk default for data

-- 
2.55.0


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

* [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments
  2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
                   ` (5 preceding siblings ...)
  2026-11-16 22:06 ` [PATCH net 6/7] mptcp: don't send a FIN before the pending data on fallback Matthieu Baerts (NGI0)
@ 2026-11-16 22:06 ` Matthieu Baerts (NGI0)
  2026-11-17 22:29   ` netdev-bot+sashiko
  6 siblings, 1 reply; 13+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-11-16 22:06 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	Dmytro Shytyi
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable,
	Chris Mason, Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

An MPTCP socket that has fallen back to TCP can silently lose received
data if a segment partly overlaps data received earlier, and recv() then
blocks, returning neither later data nor end of file.

After a fallback, subflow_check_data_avail() makes up a dummy mapping
for the skb at the head of the subflow's receive queue, in which map_seq
and map_subflow_seq must describe the same byte. But since commit
2834f8edd74d ("mptcp: cleanup fallback dummy mapping generation"), it
computes map_seq from the first byte of the skb, while map_subflow_seq
is still computed from copied_seq, the next unread byte.
mptcp_subflow_get_mapped_dsn() then returns the data sequence number
(DSN) of the first byte of the skb, instead of the one of copied_seq.

These two bytes differ for a segment that starts before rcv_nxt and ends
after it, since TCP does not trim it. mptcp_init_skb() then gives the
new bytes of this skb a DSN that is too low, and __mptcp_move_skb()
skips some of them as old data, leaving a hole in the stream:

    bytes 0 to 999 are received, the skb holds bytes 900 to 1499
      byte 1000 gets the DSN of byte 900: too low by the 100 old bytes
        that is 100 below ack_seq, the next DSN that MPTCP expects
          __mptcp_move_skb() skips bytes 1000 to 1099 as old data
            ack_seq is the DSN of byte 1400, copied_seq is byte 1500
              later data starts at the DSN of byte 1500: out of order
                the TCP FIN becomes a dummy DATA_FIN after the last byte
                  ack_seq does not reach it, so there is no end of file

Fix this by computing map_subflow_seq from the first byte of the skb as
well: mptcp_subflow_get_mapped_dsn() then returns the DSN of copied_seq.

Chris Mason sent the same fix in private, and found this issue with the
help of an LLM. It has been reproduced in a VM, with the reproducer he
shared, and with a new Packetdrill test: after a fallback to TCP, a
segment overlapping data already received is injected. Without this
patch, the new bytes at the beginning of this segment were lost, and the
connection stalled, with no end of file:

  reader   30.64: conn 1 BREAK: at my offset 1000 the bytes claim offset 1100: A GAP OF 100 BYTES
  reader   30.64: READ-TOTAL conn 1 outcome iii-gap-or-repeat bytes 1400 of 2500 [...]
  [...] end: hang: no data and no end of file for 30 s

And with the Packetdrill test:

  dss_fallback_overlap_client.pkt:24: runtime error in read call: Expected result 2500 but got 1400 with errno 115 (Operation now in progress)

Fixes: 2834f8edd74d ("mptcp: cleanup fallback dummy mapping generation")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/4c48d016490d43b6892c622cbae858b48f176cff.1794304840.git.tanggeliang@kylinos.cn [1]
Co-developed-by: Chris Mason <mason@kernel.org>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
[ Combine the commit messages of Geliang's [1] and Chris's versions.
  Commit message: how the issue was found, and its symptoms. ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 00677fb3efcd..6f07544bfe40 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1496,7 +1496,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
 	skb = skb_peek(&ssk->sk_receive_queue);
 	subflow->map_valid = 1;
 	subflow->map_data_len = skb->len;
-	subflow->map_subflow_seq = tcp_sk(ssk)->copied_seq - subflow->ssn_offset;
+	subflow->map_subflow_seq = TCP_SKB_CB(skb)->seq - subflow->ssn_offset;
 	subflow->map_seq = __mptcp_expand_seq(subflow->map_seq,
 					      subflow->iasn +
 					      TCP_SKB_CB(skb)->seq -

-- 
2.55.0


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

* Re: [PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault
  2026-11-16 22:06 ` [PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault Matthieu Baerts (NGI0)
@ 2026-11-17 22:29   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-11-17 22:29 UTC (permalink / raw)
  To: matttbe
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, fw,
	dmytro, netdev, mptcp, linux-kernel, stable, mason

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] mptcp: Fixes trailer in commit message cites 69800e516e96 instead
  of d9ca1de8c0cd

--

> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2130,8 +2130,10 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
>  	return copied;
>  
>  do_error:
> -	if (copied)
> +	if (copied) {
> +		__mptcp_push_pending(sk, msg->msg_flags);
>  		goto out;
> +	}
>  
>  	copied = sk_stream_error(sk, msg->msg_flags, ret);
>  	goto out;
>

[Severity: Low]
The Fixes tag looks off to me. Before 69800e516e96 ("mptcp: propagate
fastclose error"), a copy fault in mptcp_sendmsg() already set
ret = -EFAULT and jumped straight to out. The out label sat after the
if (copied) __mptcp_push_pending() block and returned copied ? : ret.

So with copied > 0, the already queued dfrag was left on rtx_queue
without a push even back then. 69800e516e96 only introduced do_error
to pass ret through sk_stream_error() when copied == 0. It kept the
existing if (copied) goto out; behaviour.

As far as I can tell, skipping the push on a partial copy error goes
back to d9ca1de8c0cd ("mptcp: move page frag allocation in
mptcp_sendmsg()"). That commit made mptcp_sendmsg() queue everything
first and only push after the loop.

With the current tag, stable tooling would miss kernels that have
d9ca1de8c0cd but not 69800e516e96.

Could you double check, and if you agree, point the Fixes tag at
d9ca1de8c0cd instead?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e%40kernel.org

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

* Re: [PATCH net 4/7] mptcp: push queued data on passive TFO subflows becoming established
  2026-11-16 22:06 ` [PATCH net 4/7] mptcp: push queued data on passive TFO subflows becoming established Matthieu Baerts (NGI0)
@ 2026-11-17 22:29   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-11-17 22:29 UTC (permalink / raw)
  To: matttbe
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, fw,
	dmytro, netdev, mptcp, linux-kernel, stable, mason

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] The commit message of "mptcp: push queued data on passive TFO
  subflows becoming established" describes behaviour that depends on an…

--

mptcp: push queued data on passive TFO subflows becoming established

With TCP Fast Open, data written by an MPTCP server before the third ACK
could stay queued after that ACK, because the ACK carries MP_CAPABLE
without DSS, so ack_update_msk() is never called. This commit makes
check_fully_established() call __mptcp_check_push() when a subflow becomes
fully established on a passive TFO child (syn_fastopen_child), so the data
is pushed at that point.

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

> 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-write-before-3rd-ack.pkt:24: 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 tests increase
> its interval:

[Severity: Low]
Which tree is "mptcp: arm the rtx timer if a push leaves data behind" in?

That commit doesn't seem to be present here, either at this commit or at
the end of the series. The following patch, "mptcp: push queued data on
subflows falling back at the handshake", refers to it the same way. Neither
message gives a SHA or a lore link for it.

In net/mptcp/protocol.c, __mptcp_push_pending() still arms the rtx timer
only when data was copied:

net/mptcp/protocol.c:__mptcp_push_pending() {
    ...
	/* Avoid scheduling the rtx timer if no data has been pushed; the timer
	 * will be updated on positive acks by __mptcp_cleanup_una().
	 */
	if (copied) {
		if (!mptcp_rtx_timer_pending(sk))
			mptcp_reset_rtx_timer(sk);
		mptcp_check_send_data_fin(sk);
	}
}

__mptcp_subflow_push_pending() also arms it only inside its if (copied)
block.

So in this tree, without this patch, the data would hit the "Timed out
waiting for packet" case. It would not be sent late, after the one second
delay.

Could the changelog say where that commit lives, for example with a SHA or
a lore link? That would let stable backporters find the dependency and see
how the two changes are ordered.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e%40kernel.org

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

* Re: [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake
  2026-11-16 22:06 ` [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake Matthieu Baerts (NGI0)
@ 2026-11-17 22:29   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-11-17 22:29 UTC (permalink / raw)
  To: matttbe
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, fw,
	dmytro, netdev, mptcp, linux-kernel, stable, mason

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

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

* Re: [PATCH net 6/7] mptcp: don't send a FIN before the pending data on fallback
  2026-11-16 22:06 ` [PATCH net 6/7] mptcp: don't send a FIN before the pending data on fallback Matthieu Baerts (NGI0)
@ 2026-11-17 22:29   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-11-17 22:29 UTC (permalink / raw)
  To: matttbe
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, fw,
	dmytro, netdev, mptcp, linux-kernel, stable, mason

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 0

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).

- [Medium] The new 'no FIN before new data' check in mptcp_try_fallback()
  (net/mptcp/protocol.h) is not reliable.
- [Medium] mptcp: missing pending data push after fallback in
  subflow_check_data_avail()

--

mptcp: don't send a FIN before the pending data on fallback

After this change, mptcp_try_fallback() shuts the subflow down at fallback
time only when no new data is pending before the DATA_FIN. Otherwise,
mptcp_check_send_data_fin() is expected to shut the subflow down once that
data has been pushed. This stops a TCP FIN from going out ahead of data
still in the MPTCP write queue, as in the TFO server case.

> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 011e73d04ee60..7d226ee38315d 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -1333,7 +1333,11 @@ static inline bool mptcp_try_fallback(struct sock *ssk, int fb_mib)
>  	msk = mptcp_sk(sk);
>  	if (!__mptcp_try_fallback(msk, fb_mib))
>  		return false;
> -	if (READ_ONCE(msk->snd_data_fin_enable) && !(ssk->sk_shutdown & SEND_SHUTDOWN)) {
> +
> +	/* no FIN before new data: see mptcp_check_send_data_fin() */
> +	if (READ_ONCE(msk->snd_data_fin_enable) &&
> +	    !before64(READ_ONCE(msk->snd_nxt) + 1, READ_ONCE(msk->write_seq)) &&
> +	    !(ssk->sk_shutdown & SEND_SHUTDOWN)) {

[Severity: Medium]
With this change, the subflow FIN is deferred while new data is still
pending, and mptcp_check_send_data_fin() is expected to send it once
that data has been pushed. check_fully_established() now calls
__mptcp_check_push() after a successful fallback, so that path is
covered. What about the other mptcp_try_fallback() callers?

subflow_check_data_avail() falls back on MAPPING_NODSS and
MAPPING_DUMMY:

net/mptcp/subflow.c:subflow_check_data_avail() {
    ...
		if (!mptcp_try_fallback(ssk, MPTCP_MIB_DSSFALLBACK)) {
    ...
}

mptcp_dss_corruption() does the same on a corrupted mapping:

net/mptcp/protocol.c:mptcp_dss_corruption() {
    ...
	if (!mptcp_try_fallback(ssk, MPTCP_MIB_DSSCORRUPTIONFALLBACK)) {
    ...
}

In both cases, mptcp_incoming_options() has already run for this packet
while MPTCP_FALLBACK_DONE was still clear. Without a DSS option, it
returns early, before ack_update_msk() and __mptcp_check_push() are
reached. Neither caller pushes the pending data once the fallback has
succeeded.

Before this patch, the FIN was sent here unconditionally. The data was
lost, but the connection could still be closed. Now the FIN is skipped.
If the peer doesn't send anything else, what pushes the data from
msk->first_pending and then calls mptcp_check_send_data_fin()?

The retransmit timer doesn't seem to help either. If there is unacked
data at the head of the rtx_queue, __mptcp_push_retrans() returns -1
on a fallen-back msk, and __mptcp_retrans() jumps to clear_scheduled:

net/mptcp/protocol.c:__mptcp_retrans() {
    ...
		/* Can fail only in case of fallback. */
		len = __mptcp_push_retrans(sk, dfrag, retrans_seq);
		if (len < 0)
			goto clear_scheduled;
    ...
}

This skips mptcp_check_and_set_pending(sk), so the pending data isn't
scheduled from there either.

Couldn't the connection then be left with both the pending data and
the deferred FIN stuck, so the shutdown never completes? Should
subflow_check_data_avail() and mptcp_dss_corruption() also trigger a
push after a successful fallback, like check_fully_established() does?
Or is another path expected to flush this data?

[Severity: Medium]
Is this lockless check ordered against the writer?

mptcp_try_fallback() can run in BH context with only the ssk lock held.
One example is check_fully_established(), when the 3rd ACK arrives without
MPTCP options:

net/mptcp/options.c:check_fully_established() {
    ...
	if (!mptcp_try_fallback(ssk, MPTCP_MIB_MPCAPABLEDATAFALLBACK)) {
    ...
}

The writer is __mptcp_wr_shutdown(), called from mptcp_shutdown() and
mptcp_close(). It holds only the msk socket lock, not the ssk lock or
msk->fallback_lock:

net/mptcp/protocol.c:__mptcp_wr_shutdown() {
    ...
	WRITE_ONCE(msk->write_seq, msk->write_seq + 1);
	WRITE_ONCE(msk->snd_data_fin_enable, 1);
    ...
}

Nothing orders these two stores. Nothing orders the three READ_ONCE()
loads in mptcp_try_fallback() either. The spin_lock_bh() on
msk->fallback_lock in __mptcp_try_fallback() doesn't help, because the
writer never takes that lock.

On a weakly ordered CPU such as arm64 or POWER, could the BH reader see
snd_data_fin_enable == 1 together with the old write_seq?

Suppose exactly one byte of new data is still unsent, so snd_nxt + 1
equals the old write_seq. The new check then evaluates to true, and
tcp_shutdown(ssk) sends the FIN before that byte.

After that, mptcp_check_send_data_fin() returns early on the writer side:

net/mptcp/protocol.c:mptcp_check_send_data_fin() {
    ...
	if (!msk->snd_data_fin_enable || msk->snd_nxt + 1 != msk->write_seq ||
	    mptcp_send_head(sk))
		return;
    ...
}

The byte can't be pushed later either. The subflow is now in FIN_WAIT1 or
LAST_ACK, so __tcp_can_send() fails in __mptcp_subflow_active().

Wouldn't this truncate the stream in the same way this patch is meant to
prevent, only within a narrower window? The later patch in the series,
"mptcp: fix dummy mapping of overlapping segments", doesn't touch
protocol.h or protocol.c, so the window would still be open at the end of
the series.

Would it close the window to publish snd_data_fin_enable with
smp_store_release() after the write_seq update, and read it with
smp_load_acquire() in mptcp_try_fallback()? An smp_wmb()/smp_rmb() pair
would also work.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e%40kernel.org

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

* Re: [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments
  2026-11-16 22:06 ` [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments Matthieu Baerts (NGI0)
@ 2026-11-17 22:29   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-11-17 22:29 UTC (permalink / raw)
  To: matttbe
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, fw,
	dmytro, netdev, mptcp, linux-kernel, stable, mason

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] The commit's author and the author's sign-off use different email
  addresses.

--

mptcp: fix dummy mapping of overlapping segments

After a fallback to TCP, subflow_check_data_avail() builds a dummy
mapping. This commit computes map_subflow_seq from the first byte of the
skb at the head of the receive queue instead of from copied_seq, so that
map_subflow_seq and map_seq describe the same byte. Without this, new
bytes in a segment that partly overlaps data already received get a DSN
that is too low, and they are skipped as old data.

Link: https://lore.kernel.org/4c48d016490d43b6892c622cbae858b48f176cff.1794304840.git.tanggeliang@kylinos.cn [1]

> Author: Geliang Tang <geliang@kernel.org>

[ ... ]

> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>

[Severity: Low]
This isn't a bug, but the author address and the address in the author's
sign-off are different. The author is geliang@kernel.org, and the only
sign-off from Geliang uses tanggeliang@kylinos.cn. No sign-off uses the
author address.

scripts/checkpatch.pl reports this as a FROM_SIGN_OFF_MISMATCH warning
("From:/Signed-off-by: email address mismatch"). The names match exactly
but the addresses do not, and checkpatch does not look at .mailmap.

.mailmap already maps the two addresses to the same person:

    Geliang Tang <geliang@kernel.org> <tanggeliang@kylinos.cn>

So this only affects the consistency of the tags. The DCO itself is not
in question.

Since this carries Cc: stable, could the author be set to the kylinos.cn
address, or the sign-off use geliang@kernel.org (changed or added), before
the patch is applied?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e%40kernel.org

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

end of thread, other threads:[~2026-11-17 22:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 22:06 [PATCH net 0/7] mptcp: misc fixes for v7.4-rc4 Matthieu Baerts (NGI0)
2026-11-16 22:06 ` [PATCH net 1/7] mptcp: do not use a raised snd_wnd for the send window Matthieu Baerts (NGI0)
2026-11-16 22:06 ` [PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault Matthieu Baerts (NGI0)
2026-11-17 22:29   ` netdev-bot+sashiko
2026-11-16 22:06 ` [PATCH net 3/7] mptcp: use sk instead of casting msk in check_fully_established() Matthieu Baerts (NGI0)
2026-11-16 22:06 ` [PATCH net 4/7] mptcp: push queued data on passive TFO subflows becoming established Matthieu Baerts (NGI0)
2026-11-17 22:29   ` netdev-bot+sashiko
2026-11-16 22:06 ` [PATCH net 5/7] mptcp: push queued data on subflows falling back at the handshake Matthieu Baerts (NGI0)
2026-11-17 22:29   ` netdev-bot+sashiko
2026-11-16 22:06 ` [PATCH net 6/7] mptcp: don't send a FIN before the pending data on fallback Matthieu Baerts (NGI0)
2026-11-17 22:29   ` netdev-bot+sashiko
2026-11-16 22:06 ` [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments Matthieu Baerts (NGI0)
2026-11-17 22:29   ` netdev-bot+sashiko

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