Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by "Matthieu Baerts (NGI0)"
Mon, 16 Nov 2026 22:06
[PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments
Author: "Matthieu Baerts (NGI0)"
Date: Mon, 16 Nov 2026 22:06
Date: Mon, 16 Nov 2026 22:06
77 lines
12227 bytes
12227 bytes
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
Re: [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments
Author: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 22:29
Date: Tue, 17 Nov 2026 22:29
52 lines
9933 bytes
9933 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] 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
Re: [PATCH net 7/7] mptcp: fix dummy mapping of overlapping segments
Author: Matthieu Baerts
Date: Wed, 18 Nov 2026 22:04
Date: Wed, 18 Nov 2026 22:04
51 lines
12933 bytes
12933 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:
(...)
> 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?
False positive: the author is tanggeliang@kylinos.cn, see the "From:"
line at the top of the email body. geliang@kernel.org comes from
.mailmap.
This looks like a bug in Clashiko, Sashiko didn't report that.
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