Article View: linux.kernel.netdev
Article #25974[PATCH net 6/9] mptcp: wake up blocked senders when no sf left
From: "Matthieu Baerts (NGI0)"
Date: Wed, 02 Dec 2026 21:29
Date: Wed, 02 Dec 2026 21:29
55 lines
10588 bytes
10588 bytes
When an MPTCP socket moves to TCP_CLOSE because its last subflow is
closed, after the close timeout or not, sk_shutdown was not updated, and
no error was set in most cases. A thread blocked in send() was then
never woken up for good.
Set SEND_SHUTDOWN in these cases: no more data can be sent. The blocked
send() then returns EPIPE, as a send() called after the close timeout
already does. Reporting another error first, e.g. ETIMEDOUT as TCP does
after a timeout, would change the behaviour seen by the applications:
this is left for net-next.
This was reported on GitHub, with a reproducer: the only subflow dies by
RTO, and send() was never woken up, while it returned ETIMEDOUT after a
few seconds with TCP. With this patch, send() returns EPIPE after the
subflow timeout (like TCP) and the close timeout (by default at 60
seconds). This is also validated with new Packetdrill tests, with the
close timeout, and with a reset received in CLOSE_WAIT. Without this
patch, send() stayed blocked in both cases:
close_timeout_blocked_send.pkt:24: runtime error: exiting while a blocking system call is in progress
close_wait_reset_blocked_send.pkt:25: runtime error: exiting while a blocking system call is in progress
Fixes: 27e5ccc2d5a5 ("mptcp: fix dangling connection hang-up")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/648
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 1f045348764a..e89ed0b1e421 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2756,6 +2756,8 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
} else if (sk->sk_state != TCP_ESTABLISHED ||
msk->in_accept_queue) {
mptcp_set_state(sk, TCP_CLOSE);
+ WRITE_ONCE(sk->sk_shutdown,
+ sk->sk_shutdown | SEND_SHUTDOWN);
mptcp_close_wake_up(sk);
} else {
mptcp_start_tout_timer(sk);
@@ -3247,6 +3249,7 @@ static void mptcp_worker(struct work_struct *work)
mptcp_do_fastclose(sk);
mptcp_for_each_subflow_safe(msk, subflow, tmp)
__mptcp_close_ssk(sk, subflow->tcp_sock, subflow, 0);
+ WRITE_ONCE(sk->sk_shutdown, sk->sk_shutdown | SEND_SHUTDOWN);
mptcp_close_wake_up(sk);
}
--
2.55.0
Technical Details
Message-ID:
<20261202-net-mptcp-misc-fixes-7-4-rc7-v1-6-9f03efcb1a17@kernel.org>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376066-linux-kernel-netdev=dewy.ruReferences:
<20261202-net-mptcp-misc-fixes-7-4-rc7-v1-0-9f03efcb1a17@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376066-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 6/9] mptcp: wake up blocked senders when no sf left
Date: Wed, 02 Dec 2026 22:29:36 +0100
Organization: Usenet Network
Message-ID: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-6-9f03efcb1a17@kernel.org>
References: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-0-9f03efcb1a17@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="2065914"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:n8ZJ8GZsPmBjPiADjR1ElXYxjqA= sha256:AX++tR6I3u+AcUsUKpRNzXgfov8vRdPajgTpIIgv9FU=
sha1:tfIovCuxoGaV5fJwbNoYtFRNmHE= sha256:DeN5Dk68ueqBQXVP4YHPw9fdiB2tro5WDsk3Fd7bcWk=
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 28175117723; Thu, 3 Dec 2026 00:32:29 +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 SOZVr86QEISd;
Thu, 3 Dec 2026 00:32:25 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376066-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 81582117737; Thu, 3 Dec 2026 00:32:17 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 4B05127A42; Wed, 2 Dec 2026 21:32:14 +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=1796247129;
b=x1K1VEszG3NXvDUc1xjecWFzQ8VtPt+hwIT09LEX1ccHnNORrFCWNufgwv2l1ZfPyHvE
0Og6xJxhrPqQQsXgaOCl0IAWBaD/I4EmxJpjB9ZppRVsQRmL8qTHxA/hsCf6KaaGrhPRc
l66MHmFR6UrTyn0ppriBhDzgVtyuvBQRotcyW7O9C7LPDXKYepsZvfBeCyAgFGVJKLNG5
wx5CvzOzGZRWJCYkek48mNOJT69M4iZltRf+WqFpZ2HrevtLLjQ0I93aLQfxmIweqsiU/
sPTEPbpcnHQGYZSWEEGm/VfZGFt3d2l4hrjCES6ZojwW0xW03Q0l4hEzAc+znyZJ7fg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796247129;
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=B7o7765GxGpZo3pyFPBoSGUufF/DATDXK0sGMtCzTcM=;
b=XflWBdGjvmupUn6wBMdt0nZzqS92dsPfdhGmjcegaCUFYOzQq99RsMQHPHxo6c+B2w1M
FOrzU3B86W6seygSRWATqrpj27DgPiD5HfrZrb/Z+5rC+RKnrGUdKXGHwKoStyw70rTqw
3guZx2yK7HJPJODrZrXAuTgeK53yfe1wcaqE7oR3pQP2vqF9Zh+/YkTs+QZ/VQu5jM9o4
bqXAv59cfYnyPA5/eJrKZjpFZmvuWA/SQ5mGDlEiNWcvtFY9Dy4wflidxnUwEY7igGQAT
6bE+ySCwh/H499+zq8rOH0QNndglzp5T90M4WmOFxPRWfQkfkOLJrnZGo81LRH8TepA==
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=Nu3ihxxO;
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 3FF3A606A6A3;
Wed, 2 Dec 2026 21:32:09 +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=Nu3ihxxO
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=1796247128;
b=Vs9TBNoi+g7MgW67PS9dEDAVhL6ZtLaAYpYN5PX8CRSAoAMjfL41ci5yTin/O54tTLFT
cxPgtNqI7UmeILwN1LySpub+TNsMJpFGglRAs4b6PqqYc1lQ9SpgcT/s9hP/7cG/gmcbv
NHx9S1rsiXhABqAlAcFqxiBjCO5iVIL9UeMU0Ho7qJfPr0EMlLXkzpCwpO3hrXChxl6Px
d/3cvrx+aVdMXYB8cd4SbJ4j5x2oNboRlP5Vsl46xFAI/YuNWFynk3TswyHEbvDnyo0xa
1PS+OvbpCpy2tidiAJFzC6Hr+7THnnZ9BoEbZCWf2BIE/kRXJgl+2Zrga6TplGSP/FQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796247128;
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=B7o7765GxGpZo3pyFPBoSGUufF/DATDXK0sGMtCzTcM=;
b=mAWIdD0fPVXW1uELBQSUBFGrZhMoPJz8+Y3UgFwuT8vLOVQaHSgs0rGzfvrOznPstlr5
uTQUgEMfADBnJwC96Vf2Gq7zQzZS3syzvUtb5IU7y0suvJ+7Vzhr0j43hULH89XNUMXkT
mXZy8knJ+rZwX7GSVj6+zonKJUGGmwSxeMDJGKDCSdsEfn445coul2AwChzviFaVy624h
AVvi7L91WNmKbqDjZXzNm96ezEOIIkqANw2WFCO0YT8VFbZhe4RjlZ8YXZ2QXjNI5LGnU
Nit7ltuaQ12b9ZOXSA94VAP9dkATjcTBq0tVPuK1wb/Eg8hGQ9iY/GVUlu+3EPkzd6g==
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=Nu3ihxxO;
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 5EB90606A699;
Wed, 2 Dec 2026 21:32:08 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99FF41F000C1;
Wed, 2 Dec 2026 21:32:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1796247127;
bh=B7o7765GxGpZo3pyFPBoSGUufF/DATDXK0sGMtCzTcM=;
h=From:Date:Subject:References:In-Reply-To:To:Cc;
b=Nu3ihxxO9grbjx+n78Qt2EOk4lqH7q1tKg7VdkdndKQ2vHMJWvyKmA5a9pgfwxNeK
xO/OGjNJA6RaWGPZ5T0DVtUCxgRPYkmG+CIV6dUa8MAQqakxV+6ZJsbQbCnE59p5Y0
hwJgFoM1FWxpWPzoNPSn8ipditq/XTJQRHaKxCrPbASRfrN27mz3ExpYlu+WrNfBHK
as1xahoBDM8bJJGKBSvmGJaWsvkXJFx5G82VxOoI+H8rwa9du44btWDKaz3ouxpxOc
mBt+em2QIJ059CaY/Z//aepKi8YzPriXLvttD9+/o5g3FHUo4OuqUWOdn4M1YQ7ERG
tP4xoAF+pVIxQ==
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: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-0-9f03efcb1a17@kernel.org>
X-Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
"Matthieu Baerts (NGI0)" <matttbe@kernel.org>, stable@vger.kernel.org
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=2383; i=matttbe@kernel.org;
h=from:subject:message-id; bh=awS2l3eeAl5ed2x/qT8QUOxMW9zmij6Xzpy5K4eQX30=;
b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLIF+hzzl5X+ST1Yr7P54mOTtRVsH293chx9MXn+gvubT
2qLu/2a0FHKwiDGxSArpsgi3RaZP/N5FW+Jl58FzBxWJpAhDFycAjCR6W8YGa5z+kd/bRY8IX7i
+Xuu6Ou769V/Gp/YpWAmcHVWVPqBDQsYGR55Wb/hffFKp++70FUJDsHecv8ttYerdG+yX2u+z/g
qmRkA
X-Developer-Key: i=matttbe@kernel.org; a=openpgp;
fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073