[PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault
From: Matthieu Baerts (NGI0)
Date: Mon Nov 16 2026 - 17:10:27 EST
From: Quanye Yang <quanyeyang@xxxxxxxxx>
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@xxxxxxxxxxxxxxx
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/640
Signed-off-by: Quanye Yang <quanyeyang@xxxxxxxxx>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
---
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