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 0756535FF78 for ; Tue, 3 Feb 2026 18:04:33 +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=1770141874; cv=none; b=XEBfcHyec39/HDW2OmlH4Z+KLrAB7dd765gpgcwqiYNxEAwe9b7PKvFc8hNe1Po0KkOcQJx0YNTUmkOdEQPfodEYOvytPQB1lt2hcdPnFKju9tJS7xfYqeTZgJ+o8EGFQfj1GYX/gT9Cj7QARx9ZFdwR0HDs139WevEqaTBTbFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770141874; c=relaxed/simple; bh=o8mroPSAlc0obiv5hM9sfAMEeOgFZtXazX5+mW6wA9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IQr8MMgcq1JJKT/0VsdJr+OT5gc3kWqf8uXgctzzFovIjHybcQmTNNnvkWY3hDLt5MKO+GaC5xEl04HHvYDsZLI0nrsWNeWckc/gycCyRowWQnwsm3OpFbwCltuawiqXqRL3SH7Ho3spkhO5wdYqgewg0A/kLdR3os/ExCSzcHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q7ooJGSn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q7ooJGSn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02E69C116D0; Tue, 3 Feb 2026 18:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770141873; bh=o8mroPSAlc0obiv5hM9sfAMEeOgFZtXazX5+mW6wA9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q7ooJGSnnPcB4Ys8DRRF8Wd2OPz/FGIWlDN7Ehi4milKZbmn/R+oBCKwK7epfrLGh dutj98kBslGJAXsr+fyE8MP+7JkNdr7EKnG0fGsGY2b3CqE693JevSDJpVda1vCRct I6t4DIWLeow6oNfv67p/H0hZyiH1x541Y6ZAGQNwTl71IlkpE+ehkQtvBTIYrcK6gy lZkItgbxGxvhfXSfVomONbJsHd+c0AQoJFrFbaMteWK/HQKLmpFgzH9Pk9Sr9yfZfF KQdvA8lFiR9CiLXtNkJxdkiyJrJcJtG+TWSHssP1eGU5nXWFE3iD3wToADdFcrFgsf hdKLnOs3XLxTw== From: Sasha Levin To: stable@vger.kernel.org Cc: "Matthieu Baerts (NGI0)" , Marco Angaroni , Geliang Tang , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6.y] mptcp: avoid dup SUB_CLOSED events after disconnect Date: Tue, 3 Feb 2026 13:04:30 -0500 Message-ID: <20260203180430.1352713-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026020300-graduate-counting-5eda@gregkh> References: <2026020300-graduate-counting-5eda@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- net/mptcp/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 0dbf2e0d9762d..5ec25165b6ab1 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2553,8 +2553,8 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, 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; -- 2.51.0