Article View: linux.kernel.netdev
Article #17477[PATCH net 2/7] mptcp: push pending data after a sendmsg copy fault
From: "Matthieu Baerts (NGI0)"
Date: Mon, 16 Nov 2026 22:06
Date: Mon, 16 Nov 2026 22:06
51 lines
10012 bytes
10012 bytes
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
Technical Details
Message-ID:
<20261116-net-mptcp-misc-fixes-7-4-rc4-v1-2-bf7656de653e@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364750-linux-kernel-netdev=dewy.ruReferences:
<20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364750-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 2/7] mptcp: push pending data after a sendmsg copy
fault
Date: Mon, 16 Nov 2026 23:06:09 +0100
Organization: Usenet Network
Message-ID: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-2-bf7656de653e@kernel.org>
References: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="2179287"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:fdhmpXrKK8csoYEXMMjRcF08ewc= sha256:Jrgs79ywKgt9X+xHuQFrMxopk31QtVxbLa9uoiQXmqw=
sha1:CcE5bia7CI1ZTqKTrhnMINu6NBY= sha256:0KrwhpW1XdtgVRLktZrJyRbNYUld1OuJitdhqz1mFiQ=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id CA2CF114D8C; Tue, 17 Nov 2026 01:10:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id q3jOUT1gyai2;
Tue, 17 Nov 2026 01:10:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364750-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 23030114D88; Tue, 17 Nov 2026 01:10:34 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id EF20B38159; Mon, 16 Nov 2026 22:09:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1794866944;
b=UmGgbZ5TACQYkdZJOo8IsvKPv+8UXJ/7rS6z4ki94SkMJB0Tw6w2gQYN5I7YnCe8ysWo
BDLAVcqutABjshKupEJ0OW1uEm6fgOOuloZNmHWd4sAupHS1LhFanmwDTxPtPoyMplFGN
YiDUqJrIBzQYjsemkoSZsHDCuVggnXdS/9WPg5Gf7sTMnW1GpsdZq+Th0qfVHO4OMezsb
pBwi9rIXsYweyhMSYI79LXULKNlBD+IqYmt6dn4kve2h/RW0KvR5qy2Hi0gQHmjdRX47b
7rkbpgD6OzrV6KyA9U1yQJf4YxSBHzMBGBLkVlk2VYE05ns09JgSC4n6EO5NPw8kBBw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794866944;
h=X-Original-To:Received:Received:DKIM-Signature:From:Date:Subject:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
X-Mailer:X-Developer-Signature:X-Developer-Key;
bh=fASJVZS6eae9LxRGOU8UXTUuLY6ysPWMoGJyRiEOZic=;
b=t6+kihLyddH2ZP22C2UMPex2f8NBt0dAH7WWWlByCho5MVJfsI3kjVqwgAI4YMuOhIl3
86b+OkpWplHz5MyGHPcDhNJ3Oo7WaDtSakjF1vKfjNDuKOdSUiU301tdD00dmqbR+L8vv
/lt3otKvpD3lfVuOKslrTyT03mtt1b6blX/Kl5IgVVKxAsUCY78wglMC5FzZkEml4PE/v
0LGDJAERcr5r84aaUE+XkVHY3K/k8JPk5SyAe6QBenMthRMDVD/baG6LPUsKI+hC38+Sk
KRTAxbfUtin0Ojtkt+YaQATJDWipGaC09LuBAjLLRcG+YjJeaAgT5fyTGUtFVziuwxA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CdHzTetm;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C7FA606A8B1;
Mon, 16 Nov 2026 22:09:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CdHzTetm
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794866933;
b=VUsKr1+p6/Dmy/PPXUowfJRd4/deR4qgpVPUYnnrwUCKoTowaY7yFlAMoYiOA2iH7i0n
/X3l0oPs7ejOgsyUMI61+eRRIpI0kAKeEVGIdrY4Sn4lBBKbO8cmgVgauO2+1ZB0+pTBq
vmgurGoe53nfBLyihDnPmixTYKNky2Xq42Pm9BDkdD9lIcksJhH4k1kPHm1vI62SqN2zo
1l2L7QT0RakRHdRfaqy6lYDya1jXWgwhUWPay9r8vkvQDwe3K07HRSMmCbmbeKs9s1Yqg
h8kIsPXvYqbeC3RELFpTeg43I9luRiP8gInD8OB4ozA6fywTIKMY0tp7CDuMqCartiw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794866933;
h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type:
Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
X-Mailer:X-Developer-Signature:X-Developer-Key;
bh=fASJVZS6eae9LxRGOU8UXTUuLY6ysPWMoGJyRiEOZic=;
b=NX1VddIGftNBF4CoDYo5Eusiq2XPmgHkeGjQPjHJZL/2RBYgbbtD18HPOBGdfZduUoRx
w55zOrZiJFU0Tb70w67i4s1nKMrbMxfo1aqrqTnUxMvMlOAKKRJe4YodGT5BlMQj+zaSy
wBICqG1FSjxyjIq+XjLHfbY33r6WFkGAfed5FUWlBhu4lyaouQ5+K8yyUsR3RsrRTageb
Kvy9CO5zIHXYrmdCvhCeMK7tYtovzAKitdtP7qu5GE7IVfaBXzW9c3gcQaQ4MR2H00QMH
nox8L5TOnzvH8DQR4QkZ5PShOjWswzxdNo1tzbq/prPGZ7FBV1JFE5wdUB+g9EaiVew==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CdHzTetm;
arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4ACB660A2611;
Mon, 16 Nov 2026 22:08:53 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BCD61F000C5;
Mon, 16 Nov 2026 22:08:50 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1794866932;
bh=fASJVZS6eae9LxRGOU8UXTUuLY6ysPWMoGJyRiEOZic=;
h=From:Date:Subject:References:In-Reply-To:To:Cc;
b=CdHzTetmXjvIW8qs4EVDVmVG1L1/YPkaKGG0pMK9+A71bd7ABaBGMD/70Kh1ZgcjF
0oyAFVHZoftAdWEZ4Y0SXyc732qSDx8TGxst2IYoK6yg5iGMth5G/E914nod2dL6U9
zM1HrXHnJ6dZktsvX68n9sTNlcLv9Q5ttOYVMTpiVkhjqXPc/zzbX092JSCl5BtlIS
CNOMeWAJBvRPNzpN5q5q5CU3Bd7QBTcMvHZnEGwzFnIhu9ve2zfwVhmM190kcU7NGL
/kuV78xrpGJOGvExGOFAPkCriPumEaQX2VSL7Ev9zeAYvxj4bGMWdYO9qV8o9lPkjg
riHAfybjO8HdA==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>
X-Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
Quanye Yang <quanyeyang@proton.me>, stable@vger.kernel.org
X-Mailer: b4 0.17-dev
X-Developer-Signature: v=1; a=openpgp-sha256; l=1670; i=matttbe@kernel.org;
h=from:subject:message-id; bh=306+4uW4TpE7s0K8Pmzi6N99z+xxvTfHEkxIyFliHBs=;
b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLJ+1z3TEZUzmZ025YbSqe9leQcnZbQ0iB5U2rnzSae44
czvagHRHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABO5V8LIsKuF/adz9akHs4sl
8y6lhj+Zrlp/Z4rF+ys1H/J37phq4MfI0Nx09Lk+d/b094a36usF9rmlsftN2Nz3Z2fE7e3XdD0
3sQAA
X-Developer-Key: i=matttbe@kernel.org; a=openpgp;
fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073