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 4818829AB1D; Wed, 4 Feb 2026 15:19:10 +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=1770218350; cv=none; b=bBQjww3dJDamYnqe59Hzg9MhRuDXMX/rKrzFpdVYF0Q7favcpd1yiPIYbFLncuNvm6FwDfW6OQ6IggyvEGgEhWypjnowc/sXB9nL41x4RmQkt9lWsbICxNuQE5O1dS9I+BqhzrJWcQAOqjejIm4+pKDfUnw24gQtV4dhgJ0xvSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770218350; c=relaxed/simple; bh=FDN09JFNferyKClIlEKw9I7t8Wbpl9eCsNTh35/FU8k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VWk1x3ga+HGxfMaQO+htb6ilJCGKsvX4z1z70Zz9Mn9Wml8nudRaLnGs+DnUccbvaUtmUlw45UUniGIGAE7uuvIx4B5+GTRG/11/RYdjsXMiegBjKwbyBMLbe6hlphrRakR8qJ+RU5vxn3z4eTrg6BnhV7cD14fmf/lWlBmXiqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1prYv13a; 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="1prYv13a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7851C19423; Wed, 4 Feb 2026 15:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770218350; bh=FDN09JFNferyKClIlEKw9I7t8Wbpl9eCsNTh35/FU8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1prYv13acRgiDhme9kliuE/VB+2V52ZYeGYHhC6yCyBy3OuGs5X/DR5KJIhpj+iny fZHql9zLU6R0yWsP3SmBabIbobG390EGdCG4Rnk9Q4vJdFSHkBg1fUvAFdgoVTwLyx b0v2rOopLITe4tSvGSRvUGGpxAn624LCtKlhvRhw= 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.1 275/280] mptcp: avoid dup SUB_CLOSED events after disconnect Date: Wed, 4 Feb 2026 15:40:49 +0100 Message-ID: <20260204143919.599183261@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260204143909.614719725@linuxfoundation.org> References: <20260204143909.614719725@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.1-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 @@ -2569,8 +2569,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;