🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2804

[PATCH net 2/4] mptcp: fix subflow bitfield misuse

#2804
From: "Matthieu Baerts (NGI0)"
Date: Tue, 13 Oct 2026 14:29
48 lines
7675 bytes
From: Paolo Abeni <pabeni@redhat.com>

The subflow status bitfield is protected by the subflow socket lock,
with one notable exception: the `close_event_done` bit is actually under
the msk socket lock protection.

As reported by Clashiko [1], flipping the latter bit may corrupt other
entries in the same bitfield.

Move the `close_event_done` outside the bitfield, in a 32bit hole.

Link: https://lore.kernel.org/178959153492.22033.1944011998010756543@kernel.org
Fixes: d82809b6c5f2 ("mptcp: avoid duplicated SUB_CLOSED events")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/protocol.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 0384d6a023f9..c006110b1c56 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -583,14 +583,16 @@ struct mptcp_subflow_context {
 		closing : 1,	    /* must not pass rx data to msk anymore */
 		valid_csum_seen : 1,        /* at least one csum validated */
 		is_mptfo : 1,	    /* subflow is doing TFO */
-		close_event_done : 1,       /* has done the post-closed part */
 		mpc_drop : 1,	    /* the MPC option has been dropped in a rtx */
 		resetting : 1,	    /* subflow is resetting */
-		__unused : 8;
+		__unused : 9;
 	bool	data_avail;
 	bool	scheduled;
 	bool	pm_listener;	    /* a listener managed by the kernel PM? */
 	bool	fully_established;  /* path validated */
+	bool	close_event_done;   /* has done the post-closed part,
+				     * protected by msk socket lock
+				     */
 	u32	lent_mem_frag;
 	u32	remote_nonce;
 	u64	thmac;

-- 
2.55.0
Technical Details
Message-ID: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-2-932c9b182fc7@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345683-linux-kernel-netdev=dewy.ru
References: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-0-932c9b182fc7@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345683-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 2/4] mptcp: fix subflow bitfield misuse
Date: Tue, 13 Oct 2026 16:29:20 +0200
Organization: Usenet Network
Message-ID: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-2-932c9b182fc7@kernel.org>
References: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-0-932c9b182fc7@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2090168"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:O0Lz+H77Y3nRhTZH/gbJC8oCjuM= sha256:UpA1Zz1btqgq9TTft+WAq22m/nsyk4qXt5Aa/aDRb/I=
	sha1:Rj995QSvSrTMW/er9+bxRr+MQLI= sha256:7YQpOL3aZz228p6f8eVaLaKfaAqXGF+7GETFsb65/Jc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 6E60E10FE74; Tue, 13 Oct 2026 18:46:23 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.34
X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 923rrYdFakjs;
	Tue, 13 Oct 2026 18:46:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-345683-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id D7C5B10FE72; Tue, 13 Oct 2026 18:46:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 98D99A3369; Tue, 13 Oct 2026 14:37:29 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C673D51AFE5;
	Tue, 13 Oct 2026 14:29:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SOVxeA7O"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(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 B54BA51AEFB;
	Tue, 13 Oct 2026 14:29:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791901795; cv=none; b=RhSy94CIKKfvf6uEnufjDmH88/USc3TCerHms+yaz2OPu758J09bdp6kwnVVO7qTIN1RXUEXFIYS/2OgHWHoqlk4JP+SPbkHN19yW9WJKgCSK1hEROgyKdaIx0re3dFXnFJUoXlLMzMJm2PdheDFkAvQlylk2JFuv1QYBvv2KPU=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791901795; c=relaxed/simple;
	bh=IvmPeIWKbIdDQhu3k7rq2ae/m0FpaQCHsciuMxFy7xM=;
	h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
	 In-Reply-To:To:Cc; b=YfLO/sInvjMEgCxB4patfwIxSy9ms5Xlt1G0ep3Ni5rqP+CgOdkULuowlUMRvbGZzucDYIwnnVOzfDhfgi0/ElUYb0mtKG1Sm/Ze4OSY4vAqtU8Woy0JG5YL6Udmi2MmB12PaAAazSlqXlI6H7Ucs2g5SmHNkmPXn9DJIfZ4pxs=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SOVxeA7O; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E9121F000FF;
	Tue, 13 Oct 2026 14:29:52 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791901794;
	bh=qEbGMwUHO3ICleo5qtNmsGP+sowO90rtVbwha07uOxs=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=SOVxeA7OgFka90fnxE6A5R4B6v7YnDpnxtwaRmJNWXwQ97plNQJf/r9buZNG7R41h
	 W1v+NnzeN7B64s5IMFsP6iT/TgmblsSRjn1uMcR4CNPXcYDSNA+mp0OFBd1Kr/bJ3J
	 +GJhp57wRf9OzHB9QPIvajny9pkyRgldfHc/E1mvSTFpwBbnDWYDe7OSD6wozew72l
	 /6W6koQFwgp/wF+b8w5Dgtu1b6htPUzeUGvGWja7pzxMYdNVm1orV9zexUWr1pClbd
	 gVC2M9gaURnY/dxdcP8obZPBlYYKXSehphoGAo6xvabqmpOnteT0840uj8veMd2Yo0
	 oY4PBnm4lJQcQ==
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261013-net-mptcp-misc-fixes-7-3-rc8-v1-0-932c9b182fc7@kernel.org>
X-Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, 
 linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" <matttbe@kernel.org>, 
 stable@vger.kernel.org
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=1744; i=matttbe@kernel.org;
 h=from:subject:message-id; bh=OedQJ+3W2bT/NjckhNpmoU9snv245QD8tSRsUaxFN2M=;
 b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLLOOYSvuXX6STFrn40Fc0y44TQxRwaVso3PZ5iyTCler
 uWkF97aUcrCIMbFICumyCLdFpk/83kVb4mXnwXMHFYmkCEMXJwCMJFFcowMh1oP+AuoB5ZfePrt
 zWoNPzZxnSDdlbOvnNU+r8ZXeLovn5Ghba5P9o4mfvHnW9xPszUGX0pubsw4uPOFdtLWrfkZO56
 yAgA=
X-Developer-Key: i=matttbe@kernel.org; a=openpgp;
 fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073