🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17476

[PATCH net 3/7] mptcp: use sk instead of casting msk in check_fully_established()

#17476
From: "Matthieu Baerts (NGI0)"
Date: Mon, 16 Nov 2026 22:06
47 lines
9883 bytes
The MPTCP socket is cast to a struct sock in check_fully_established(),
to take its data lock. The next commits need it more, to push the
pending data.

Add a local 'sk' variable instead of casting msk each time: no
functional change.

The 'Fixes' tag here below is the same as the one from the next
commits: this patch is needed to fix the issues introduced by this
commit ID.

Fixes: 36b122baf6a8 ("mptcp: add subflow_v(4,6)_send_synack()")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/options.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index a1e65309171e..1c58468b985b 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -982,6 +982,8 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 				    struct sk_buff *skb,
 				    struct mptcp_options_received *mp_opt)
 {
+	struct sock *sk = (struct sock *)msk;
+
 	/* here we can process OoO, in-window pkts, only in-sequence 4th ack
 	 * will make the subflow fully established
 	 */
@@ -1043,9 +1045,9 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 	if (mp_opt->deny_join_id0)
 		WRITE_ONCE(msk->pm.remote_deny_join_id0, true);
 
-	mptcp_data_lock((struct sock *)msk);
+	mptcp_data_lock(sk);
 	__mptcp_subflow_fully_established(msk, subflow, mp_opt);
-	mptcp_data_unlock((struct sock *)msk);
+	mptcp_data_unlock(sk);
 
 check_notify:
 	/* if the subflow is not already linked into the conn_list, we can't

-- 
2.55.0
Technical Details
Message-ID: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-3-bf7656de653e@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364751-linux-kernel-netdev=dewy.ru
References: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364751-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 3/7] mptcp: use sk instead of casting msk in
 check_fully_established()
Date: Mon, 16 Nov 2026 23:06:10 +0100
Organization: Usenet Network
Message-ID: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-3-bf7656de653e@kernel.org>
References: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2179192"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pa3qn3QpaeKRwjQ9bHQW3iyb5b8= sha256:MUEzcEbHRiY1IPGNaVgf18opBkackcwFmgqdMPQOwvg=
	sha1:EXMEwcgg2jietgTetDN/0TEy2Ko= sha256:H/4IiIEwvBKH+Dn3QGFxS/fDWNJzLPA/CuXGcv1J6zo=
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 692CF114D8B; Tue, 17 Nov 2026 01:10:31 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, 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 XQ2CAYtYa__j;
	Tue, 17 Nov 2026 01:10:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364751-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 71301114D88; Tue, 17 Nov 2026 01:10:20 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id DD52437C5C; Mon, 16 Nov 2026 22:09:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794866937;
	b=YOkSEXB+fTWmLVrUTZYnqN1L3Qb1rcymloXJLfiKBgvnmqRSggYyiR+OLBQvcd0Xy7O2
	 QhiFHzfxAh1TVOlliN4kB9rZPn29tmjFX0fib6C36zSNjj5L7o09zLdtsiB+TIq7Pc2m5
	 0o2Lu4M3RQmmVfwtkDZfE5z15yHT+mEZglxAi9d8/qMTgZGqSg6YbZVOGmj4YTqdaF8hh
	 n9V4PBcPDdcoaS9Yhp4pFWho8r9RWBC1DxcJOaCALvMnUNyKTmw3KR8YgTa51/zppUtK4
	 WYC6Iz5SDA+fE1Y4+gVY1rJ/bsj+YU1ZMnvfrBjG6OLMT0TadQ7wPHndQNUsPxNIaVA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794866937;
	h=X-Original-To:Received:Received:DKIM-Signature:From:Date:Subject:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
	 X-Mailer:X-Developer-Signature:X-Developer-Key;
	bh=Tj2/cFIwMQiU0oTdy1lbkijRfjf34Z7e24OcuJwQONY=;
	b=0Ky+5jCYtDziQsdC7FLrMY5sc55mrBkYZoQbu4ZglsdDtN+ThZpXZrJUN2ztmSCvgXLc
	 SHgH6S+Pxo/RjoRt95bPYPD3qoQ0VATmwIpnxgNwmXBYnJ5rj9oIzBItnyG3dbmGvmwPb
	 zj+IsFdxZGAchGt5eqE7YqxwGPlf7TdqBvv/vIjCKpFgO0NaNy5ZvW1BaNxXKBYQyB4zl
	 YLQ7OpGCQe0NsSVpO8umhdWtMBx1+7Pqh/c+TE35ZqyXr9vFuEaULPJrpqn3k2NKI3dI9
	 0X4eH9IJbrqFibfMIaNKc90ccMhnN2leFfDXeKPHqH25Q8Jgm2beYhr/QeVzr0QnToQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=S2QqxXbK;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E456960A3814;
	Mon, 16 Nov 2026 22:08:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=S2QqxXbK
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794866936;
	b=gAQjedInxhY7zLrzObvboUxavZ3ZB+TH9m2242KPX06aHe7kXAs2OH6YPpMsn8w5BaOt
	 WglmY1kzTHcYReoYC843hYHBcegPWjGOJBbjEhptDr9ZsjOxIl08F5TxVf4JZeHP7QS2q
	 cTBK9ngWShdR7PgzVjp/90ZpEUxXJ2vX+exrpvucGNMIgD/GhrK3VzeVRVsRGFyLJ7C4b
	 mQAbYYbIgLI2mYAmKYKb904VTB5+w3U+9gnjWu5/umN0Kn9t70r8XBXPreFXg9I/jj8zH
	 vcwTMl6/ltcJKcEXO9fnM2tM3OQ45btLIYm8G1BbxOa/mPsc2Dc0CaPiYFqcNdBfbrg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794866936;
	h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type:
	 Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc:
	 X-Mailer:X-Developer-Signature:X-Developer-Key;
	bh=Tj2/cFIwMQiU0oTdy1lbkijRfjf34Z7e24OcuJwQONY=;
	b=xyaKL7uNFZ0Otwj0zdXSPQXmjkRtSlW03hDDcL2hpzvfoOLzHmn+8Bdcb+O1VsadjyiU
	 cEpw4+hRypdy+vuAeSAVi4smLqW8+xCpapAFHGTVEAaKzNgZAngUfNpi7aBY1/krunRdM
	 N1o3PMQydmiS3Zvyyx1PNFrgNhaRot2pLgHPef/UMrzQcq0Y3gggadNyX9SsG6SUOF6F9
	 apAxYf+UFJ6dl55xqIJHTMRI3NY+7dvyoBOJf7xIw6GopQ6Jf38qGRRYEmkJgvdTFTHNx
	 YclyQ1YfKG1FjJsLWF+dJOba8Qzas4hYO1Evq3beqa44896yx3OjwCWqo+Mnxu2cxBA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=S2QqxXbK;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 127D160A262C;
	Mon, 16 Nov 2026 22:08:55 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 528D01F000C6;
	Mon, 16 Nov 2026 22:08:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794866935;
	bh=Tj2/cFIwMQiU0oTdy1lbkijRfjf34Z7e24OcuJwQONY=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=S2QqxXbKe3sufn9poQhFXU+WJWVCh02pWq02vwmIQE05eLt1F4Vwr598L+IcJjXCU
	 S3G9NdVNUhFT5+hRNd4wuZ3/J59ExXMHRrgssn10qAvpSjCPocX+vg+ouvrMb+eE/p
	 WpqF8gMQF53r0CpFMdwAOZHGv3twWC116J+A+UBhDdV5EUr/7wnnCtXOW5XD3b4vgH
	 XhMmm+cRDu+LpEHUVM6ksGHxX3a+yA3vucCOKOQtySyrYDPSp6jItAuX56Cn8y31U7
	 nFzHxWsJYU1co4DTSmg+WrAoTxKZlgq/jmRqJEKBPDxMjzVsYWHC+DoVH684az4tUu
	 Y5UUa6gqQULsQ==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@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.17-dev
X-Developer-Signature: v=1; a=openpgp-sha256; l=1620; i=matttbe@kernel.org;
 h=from:subject:message-id; bh=QwxgCSzbTvt4gHjKMplH154tKIyEr+lvY7q4aegDmF0=;
 b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLJ+1z23fnLld3ls6skXL7+sFC46P///4rz3G2oOPHviz
 bKWd2bNkY5SFgYxLgZZMUUW6bbI/JnPq3hLvPwsYOawMoEMYeDiFICJLF7AyPDPRH6F46Y01aYF
 RzRnm5VtPMz1dtvUDfU+F/Xam6Rn39Nl+MU89d+MzgdM/0z7jn5e+3zB2buXnU7Nf1NetICF40V
 GQiMrAA==
X-Developer-Key: i=matttbe@kernel.org; a=openpgp;
 fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073