From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796334716; b=KUR8TNv1NxRxvqzIuNIk+VW19KkEYczHeVEzHcJOLGuW46dVaxj61SyMVZX9m0tA6lJ/ F3AGDqEH5xGZ+z0XqOHorTT6wRT7m1IbcvyXfLarjlriO7v6y7w39Pb8nsvSFeuwWhvDg R0FJhCcsw7KEY2+RFqYzpL4i82rSOkryKe8Ky/lH8obaJ3uZQRkTMSKKijBLe/28qrz+k hNMxRDNpe65u8wC6U/xH6DFFRCH9OmfCFA/aaYEEkYM6zfzWrmjOCeUTO9aGTsIqFaMjh oxFLMJfC/rJdrmVcw8Mq/x3HVUijC9gpTt53Qh4YnUgwQNgjSyuwGq2g9vs4yDrkTjg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796334716; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=oR2A0cA2yOC+fDasOYZI3+ufh+ZP0WUlhr+3alZriQM=; b=TtGMsvfaE4/DrxvhMGTmdKULRSb3tLAnrSpGrBqrMIMI0Euc7WL5NMHjcHvIl70GRrkI gtzkXG/gGIf5eGIgy+42+z7eg77P4KdZjAlBVofao4x4uHVDZqhfCXPmPCNiF4ddKGiKO LSKhYQi0CvHayozYYe3zZ0tJwjU7XbgAFYGm0unZnFLlLyeyHNk7VyudJnFngEUkAV/rZ 0YpUR46KPdgqVVgMnZYaVjRPjTW5PRXBjpKEms6klkU8FHC2ISg+FHbtNoJP4LOLC8/MU TxLfZuw+lNTtizYE6PyJlwGrzRnS8kSGhqjbXoj3w33XSVl9hFeuQCAk5NSH8LCrNLQ== 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=SKhSSyQv; arc=none smtp.remote-ip=100.103.45.18 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 2BAD0606A6B1; Thu, 3 Dec 2026 21:51:55 +0000 (UTC) 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=SKhSSyQv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C4071F00933; Thu, 3 Dec 2026 21:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796334715; bh=oR2A0cA2yOC+fDasOYZI3+ufh+ZP0WUlhr+3alZriQM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SKhSSyQv7T/r0YSHLDA5NxyJMRELkR8lklR/HXgfEVvV8bpQOaALqZJbJQtkIkDjX OIgXsK4C8YNw4BDd/JwIFoXVtOdHq5/ajDdMaQdO3BA/uECx+K8h7oR8ndRuq/Gi1+ jZxpSdPudlBZwZcemEVdRTwmdH5taCWLMTKIY9s/vo+XX5udqZ3j12HOUr3RhBFsk+ OBN/SS0R/FkwQF09OGsFgBVzgC4tV8F6eaRaiXEQzXgw9nKZWs3p5LdhB8rYlWsfH6 RmdYVdVAAfaqxpPiInUwAFXOY8apcQY9L204Km1sCge8i4+wv/sCpXS8wsIms6erQk P3/EoW9ST9llQ== Subject: Re: [PATCH net 6/9] mptcp: wake up blocked senders when no sf left From: netdev-bot+sashiko@kernel.org To: matttbe@kernel.org Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, dcaratti@redhat.com, netdev@vger.kernel.org, mptcp@lists.linux.dev, mason@kernel.org, stable@vger.kernel.org Date: Thu, 03 Dec 2026 21:51:54 +0000 Message-ID: <179633471458.3146.5840974819566449849@kernel.org> In-Reply-To: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-6-9f03efcb1a17@kernel.org> References: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-6-9f03efcb1a17@kernel.org> X-sashiko-severity: High Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 1 · Medium: 0 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [High] A blocked send() can still hang forever after the last subflow is gone, so the bug in this patch's title ("wake up blocked senders… -- mptcp: wake up blocked senders when no sf left This commit sets SEND_SHUTDOWN on the msk when it moves to TCP_CLOSE because its last subflow is gone. This is done at the bottom of __mptcp_close_ssk() and in the close-timeout branch of mptcp_worker(). A send() blocked waiting for memory then returns EPIPE instead of hanging. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/648 > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c > index 1f045348764ad..e89ed0b1e4218 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); [Severity: High] Can a blocked send() still hang forever if the only remaining subflow is msk->first and the path manager closes it gracefully? Both new SEND_SHUTDOWN writes depend on the "all subflows closed" check at the bottom of __mptcp_close_ssk(). That check requires msk->first to already be in TCP_CLOSE: if (list_is_singular(&msk->conn_list) && msk->first && inet_sk_state_load(msk->first) == TCP_CLOSE) { A peer that sends RM_ADDR for remote id 0 reaches this path. So does a userspace PM subflow destroy through mptcp_pm_nl_subflow_destroy_doit(): mptcp_pm_rm_addr_or_subflow() mptcp_subflow_shutdown(sk, ssk, how) mptcp_close_ssk() subflow->close_event_done = true; __mptcp_close_ssk(sk, ssk, subflow, MPTCP_CF_PUSH) __mptcp_subflow_disconnect() tcp_shutdown(ssk, SEND_SHUTDOWN); mptcp_pm_rm_addr_or_subflow() only skips subflows in FIN_WAIT1, FIN_WAIT2, CLOSING or CLOSE. It has no check for the last subflow. free_first is only set at destroy time, so dispose_it is false for msk->first. __mptcp_subflow_disconnect() therefore only sends a FIN, and the ssk ends up in FIN_WAIT1, not TCP_CLOSE. The check above is then false, so none of its three branches runs. The msk does not move to TCP_CLOSE, SEND_SHUTDOWN is not set, and mptcp_start_tout_timer() is not called. Later the ssk reaches TCP_CLOSE. subflow_sched_work_if_closed() sets MPTCP_WORK_CLOSE_SUBFLOW, and __mptcp_close_subflow() calls mptcp_close_ssk() again. That call returns early: if (subflow->close_event_done || READ_ONCE(subflow->local_id) < 0) return; So the "all subflows closed" check is never run again for this subflow. The msk then stays in TCP_ESTABLISHED with no usable subflow: - probe_timestamp is never set, so mptcp_close_tout_expired() stays false and the new SEND_SHUTDOWN in mptcp_worker() is never reached. - __mptcp_subflow_error_report() only passes errors on in SYN_SENT or after fallback, so sk_err is never set. A sender waiting in sk_stream_wait_memory() would never see sk_err, SEND_SHUTDOWN or freed write memory. Should this path re-check "all subflows closed" when a FIN-shut first subflow later reaches TCP_CLOSE, even with close_event_done set? Or should it arm the close timeout here? [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-net-mptcp-misc-fixes-7-4-rc7-v1-0-9f03efcb1a17%40kernel.org