From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D9FB21FF4C; Wed, 4 Feb 2026 15:27:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770218852; cv=none; b=PqTN1LwAfrtNOU3g/451uTmLai8ZDbVEUKJr4S+0uwyBc9wh8f1hdLCtsV3iQvGLhbFPgqWFsVKrybzsn8Th2tT9a5S1YKW8/CHs93xU0CvHybcqBfHoHcjhyASeA/XzKPIVfu2vzRNSoPZ+gco+Ee6YjmhPCeD79iyjOrBbVnE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770218852; c=relaxed/simple; bh=n9XOavn3+XIU3IrrPKhSCYLenAH4HUND+s84snbLsw8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a65H1pAvWOj7KhUZf7qskSrNqro8eu3QlJ+BJ9X7rtzf0Eajs3MZxlcn2GbjxcUdlaG1s+dIpIdmbLdjOVLbMuNYEojXMm9lMLcV8zXFoP2BEgH7FcKhuegQzH0b9P7X3Vc5XIrKgl3IvftUHd+KnHq7ReBAqQZmDzI27SBay9E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=P5tqFeOV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="P5tqFeOV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9604DC4CEF7; Wed, 4 Feb 2026 15:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770218852; bh=n9XOavn3+XIU3IrrPKhSCYLenAH4HUND+s84snbLsw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5tqFeOVRo1D2R9hHxKQU3iowp13P5h4iXNagSumZD0Gw8bwPpxpBSC2dr9q+42/j 5txJ6p3x7MNQhzra4fjINHZDN21qu1wRn7qH+cDKI44jex9dL1UF2vqbTdn8k7GXcr n0hgUQt7ZpbupODzwYJS42muwxU+V69fZwjHUF4E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Marco Angaroni , Geliang Tang , "Matthieu Baerts (NGI0)" , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 79/87] mptcp: avoid dup SUB_CLOSED events after disconnect Date: Wed, 4 Feb 2026 15:41:17 +0100 Message-ID: <20260204143849.765435919@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260204143846.906385641@linuxfoundation.org> References: <20260204143846.906385641@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Matthieu Baerts (NGI0)" [ Upstream commit 280d654324e33f8e6e3641f76764694c7b64c5db ] In case of subflow disconnect(), which can also happen with the first subflow in case of errors like timeout or reset, mptcp_subflow_ctx_reset will reset most fields from the mptcp_subflow_context structure, including close_event_done. Then, when another subflow is closed, yet another SUB_CLOSED event for the disconnected initial subflow is sent. Because of the previous reset, there are no source address and destination port. A solution is then to also check the subflow's local id: it shouldn't be negative anyway. Another solution would be not to reset subflow->close_event_done at disconnect time, but when reused. But then, probably the whole reset could be done when being reused. Let's not change this logic, similar to TCP with tcp_disconnect(). Fixes: d82809b6c5f2 ("mptcp: avoid duplicated SUB_CLOSED events") Cc: stable@vger.kernel.org Reported-by: Marco Angaroni Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/603 Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260127-net-mptcp-dup-nl-events-v1-1-7f71e1bc4feb@kernel.org Signed-off-by: Jakub Kicinski [ Adjust context ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/mptcp/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2591,8 +2591,8 @@ out: void mptcp_close_ssk(struct sock *sk, struct sock *ssk, struct mptcp_subflow_context *subflow) { - /* The first subflow can already be closed and still in the list */ - if (subflow->close_event_done) + /* The first subflow can already be closed or disconnected */ + if (subflow->close_event_done || READ_ONCE(subflow->local_id) < 0) return; subflow->close_event_done = true;