* [PATCH mptcp-net 0/2] mptcp: a couple of fixes
@ 2025-11-10 14:40 Paolo Abeni
2025-11-10 14:40 ` [PATCH mptcp-net 1/2] mptcp: do not fallback when OoO is present Paolo Abeni
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Paolo Abeni @ 2025-11-10 14:40 UTC (permalink / raw)
To: mptcp
The first patch addresses a recently filed issue, 2nd one is due to
code inspection while investigating the mentioned issue.
Paolo Abeni (2):
mptcp: do not fallback when OoO is present
mptcp: do not drop partial packets.
net/mptcp/protocol.c | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
--
2.51.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH mptcp-net 1/2] mptcp: do not fallback when OoO is present
2025-11-10 14:40 [PATCH mptcp-net 0/2] mptcp: a couple of fixes Paolo Abeni
@ 2025-11-10 14:40 ` Paolo Abeni
2025-11-10 14:40 ` [PATCH mptcp-net 2/2] mptcp: do not drop partial packets Paolo Abeni
2025-11-10 16:58 ` [PATCH mptcp-net 0/2] mptcp: a couple of fixes MPTCP CI
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2025-11-10 14:40 UTC (permalink / raw)
To: mptcp
In case of DSS corruption, the MPTCP protocol tries to avoid the
subflow reset if fallback is possible. Such corruptions happen in
the receive path; to ensure fallback is possible the stack additionally
need to check for OoO data, otherwise the fallback will break the data
stream.
Fixes: e32d262c89e2 ("mptcp: handle consistently DSS corruption")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/598
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
Note: this does not avoid the WARN(), but fixes the inconsistend
read() behavior; the ingress data is OoO, we should not ack it
---
net/mptcp/protocol.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index d6b08e1de358..7b966f105f89 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -646,7 +646,8 @@ static void mptcp_check_data_fin(struct sock *sk)
static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock *ssk)
{
- if (!mptcp_try_fallback(ssk, MPTCP_MIB_DSSCORRUPTIONFALLBACK)) {
+ if (!RB_EMPTY_ROOT(&msk->out_of_order_queue) ||
+ !mptcp_try_fallback(ssk, MPTCP_MIB_DSSCORRUPTIONFALLBACK)) {
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSCORRUPTIONRESET);
mptcp_subflow_reset(ssk);
}
--
2.51.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH mptcp-net 2/2] mptcp: do not drop partial packets.
2025-11-10 14:40 [PATCH mptcp-net 0/2] mptcp: a couple of fixes Paolo Abeni
2025-11-10 14:40 ` [PATCH mptcp-net 1/2] mptcp: do not fallback when OoO is present Paolo Abeni
@ 2025-11-10 14:40 ` Paolo Abeni
2025-11-10 16:58 ` [PATCH mptcp-net 0/2] mptcp: a couple of fixes MPTCP CI
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2025-11-10 14:40 UTC (permalink / raw)
To: mptcp
Currently MPTCP drops partial packets for no good reason at all.
Instead we should just skip the already acked bytes.
Also add a missing check for zero window.
Fixes: ab174ad8ef76 ("mptcp: move ooo skbs into msk out of order queue.")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
Note: this does not avoid the WARN(), but makes the received
data avail to user-space.
We should also add a MIB for zerowin drop, but that should be a follow-up
patch, I think.
---
net/mptcp/protocol.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 7b966f105f89..e3330141a6da 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -378,6 +378,10 @@ static bool __mptcp_move_skb(struct sock *sk, struct sk_buff *skb)
mptcp_borrow_fwdmem(sk, skb);
+ /* Check for zero window.*/
+ if (atomic64_read(&msk->rcv_wnd_sent) == msk->ack_seq)
+ goto drop;
+
if (MPTCP_SKB_CB(skb)->map_seq == msk->ack_seq) {
/* in sequence */
msk->bytes_received += copy_len;
@@ -386,18 +390,27 @@ static bool __mptcp_move_skb(struct sock *sk, struct sk_buff *skb)
if (tail && mptcp_try_coalesce(sk, tail, skb))
return true;
- skb_set_owner_r(skb, sk);
- __skb_queue_tail(&sk->sk_receive_queue, skb);
- return true;
+ goto enqueue;
} else if (after64(MPTCP_SKB_CB(skb)->map_seq, msk->ack_seq)) {
mptcp_data_queue_ofo(msk, skb);
return false;
}
- /* old data, keep it simple and drop the whole pkt, sender
- * will retransmit as needed, if needed.
- */
- MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_DUPDATA);
+ /* Check for old data. */
+ if (!after64(MPTCP_SKB_CB(skb)->end_seq, msk->ack_seq)) {
+ MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_DUPDATA);
+ goto drop;
+ }
+
+ /* Partial packet, seq < rcv_next < end_seq. */
+ MPTCP_SKB_CB(skb)->offset += msk->ack_seq - MPTCP_SKB_CB(skb)->map_seq;
+
+enqueue:
+ skb_set_owner_r(skb, sk);
+ __skb_queue_tail(&sk->sk_receive_queue, skb);
+ return true;
+
+drop:
mptcp_drop(sk, skb);
return false;
}
--
2.51.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-net 0/2] mptcp: a couple of fixes
2025-11-10 14:40 [PATCH mptcp-net 0/2] mptcp: a couple of fixes Paolo Abeni
2025-11-10 14:40 ` [PATCH mptcp-net 1/2] mptcp: do not fallback when OoO is present Paolo Abeni
2025-11-10 14:40 ` [PATCH mptcp-net 2/2] mptcp: do not drop partial packets Paolo Abeni
@ 2025-11-10 16:58 ` MPTCP CI
2 siblings, 0 replies; 4+ messages in thread
From: MPTCP CI @ 2025-11-10 16:58 UTC (permalink / raw)
To: Paolo Abeni; +Cc: mptcp
Hi Paolo,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join): Unstable: 10 failed test(s): packetdrill_dss packetdrill_fastclose packetdrill_fastopen packetdrill_mp_join packetdrill_mp_prio packetdrill_mp_reset packetdrill_sockopts packetdrill_syscalls selftest_mptcp_connect selftest_mptcp_sockopt - Critical: 85 Call Trace(s) - Critical: Global Timeout ❌
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Unstable: 11 failed test(s): packetdrill_dss packetdrill_fastclose packetdrill_fastopen packetdrill_mp_join packetdrill_mp_prio packetdrill_mp_reset packetdrill_sockopts packetdrill_syscalls selftest_mptcp_connect_checksum selftest_mptcp_connect_mmap selftest_mptcp_sockopt 🔴
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/19235857403
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/5213638ed0df
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1021627
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-10 16:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 14:40 [PATCH mptcp-net 0/2] mptcp: a couple of fixes Paolo Abeni
2025-11-10 14:40 ` [PATCH mptcp-net 1/2] mptcp: do not fallback when OoO is present Paolo Abeni
2025-11-10 14:40 ` [PATCH mptcp-net 2/2] mptcp: do not drop partial packets Paolo Abeni
2025-11-10 16:58 ` [PATCH mptcp-net 0/2] mptcp: a couple of fixes MPTCP CI
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox