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 F0B7F28853E; Wed, 4 Feb 2026 15:02:39 +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=1770217360; cv=none; b=KPNVa1nUTbrT4M4NJdqM9mjvS/wCrBSAcmGD/65yknUCj/oOa0AU0B7sCCz6pnkUemq0UnjJrgW2kes1mvoFK17uOZweTnDFvGUsmvYIm8pdYBZwLw7s82hA4rJA2UDgaPlIArAsJo72wR4aB8S6WNRGOucYLbryQD4obmXDQZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770217360; c=relaxed/simple; bh=KXrrdqLHf2w3gui6a6OP9RndNRjyav3YMWNapFMBU6U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OCHh4cgfvMi1zp8uhiC/vYV2CxDLQ87FZaISqzqAx/COWznO/G0ry/Ro2xiLIDrhIY0dytbdONk5yYRXcUN+KQI+BcV/Z5D8MlQmdssaueuzwmu6koW2fgTdffdNAeEdN6yn4gs5rY0UgqOCKM6FYPe3IOGgC2DiCoB6LiH2+x8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UMjp3euW; 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="UMjp3euW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71BCFC4CEF7; Wed, 4 Feb 2026 15:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770217359; bh=KXrrdqLHf2w3gui6a6OP9RndNRjyav3YMWNapFMBU6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UMjp3euWTdIkgknju7ndg+OiBcLGTJWhFffPu7RTSoVTJv6WfJ+Rnpdi24AQPwaSk Yw6oYTnhO7yJypjufIIyz47Eah5/R6KpU4h7UWAwRVwhB/4D6z2uT86cBsSeXCNbYg wGzl1byax4xtTNbEtNxo5H1TcZoPelV7x1Ab+pR8= 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 5.15 199/206] mptcp: avoid dup SUB_CLOSED events after disconnect Date: Wed, 4 Feb 2026 15:40:30 +0100 Message-ID: <20260204143905.395067641@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260204143858.193781818@linuxfoundation.org> References: <20260204143858.193781818@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 5.15-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 @@ -2398,8 +2398,8 @@ static void __mptcp_close_ssk(struct soc 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;