From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387433; b=WOBjjFknReJRYfgZpBHiNo23I9XffmH5OAVSYLgySTCGTQ/AdMHTEVETnclnS9VwdDCt sWDmuqJEV7NWKsg6s6k7thyBGaqUZa+cdrl6ZVKDml1XbCSIMH9/I+PU5dzppbSr1mmte 9wSgK8lceIPDIKRaBLHnMe05v26LsCWp+Res6gOQd0Tq6vQdwZALY5gHV/+wTt8lZZVjd UX3r7zgbOUkAgCA82PAoOjT/QevhsstvGK9RY1LyDSzUEjKP+B8R/z7VSLUAgClAnfJoG 9tK9H9lKPk1HPHlMudB++vpaoekXvYUHHCIIPSnDc8PNfBkOWJghDMztvFOVT5YC5Mw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387433; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=iRUZlrtF0BQkdCuk5+7LfbUkCueW8Voh/hmKPFBOppY=; b=wdDCERWozPaEd2BI4npjN9PZIErRo1VpEI8bmxQvK2eT7KOB62JnZ/rLxvFwBq5k0tIm roYKvx1Fa1riXkUiPR5crMoaq1o85myJT5qqOsZtrErFJAqy/ISFP+n50mqrAiu4lkP+/ NtnRA/CYa7TYR9KYdgyZI3VRM9DDZcoHaW89/tkvuexK0MJI1mMb9P7JYxLXa9A4PzeY8 GOTDyBB72gitfCyB4R83MAOdCO1n/l9E8YZ/CUr8ErBUUYCu1+i3p56LAgxCuUWB9i+8t j6djJ+VdzzM6kzM9fPXs6OdAumT8EL9J9wBIC1dtMsM81U4XLmau4lYb0aq9TRekhzg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=LY7FrNx9; arc=none smtp.remote-ip=100.103.45.18 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 8C345606A33B; Fri, 4 Dec 2026 12:30:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=LY7FrNx9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09EDB1F000CE; Fri, 4 Dec 2026 12:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387433; bh=iRUZlrtF0BQkdCuk5+7LfbUkCueW8Voh/hmKPFBOppY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LY7FrNx9HVm79efq7R7vsATy5+5pfSL9JyHOG3eLup4Z4oFwEB+LtpbKEm1LHUO4X Dhlmzezk1A2m0uzAeDkfitq8a+GR4xXA3jfnrc1KrAIETcaCEP+Xggil0oSWHxQuiH lKpF9JU/3jNDdPkdmSu7avEqixade+wIBu+BirBQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kimi Security Team , Jiayuan Chen , Paolo Abeni , Yilin Zhang , "Matthieu Baerts (NGI0)" , Sasha Levin Subject: [PATCH 6.1 0242/1059] mptcp: do not use Fast Open on MP_JOIN subflows Date: Fri, 4 Dec 2026 18:56:13 +0900 Message-ID: <20261204100650.543336326@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yilin Zhang [ Upstream commit 6d2cf411aba2aa0bd641b49be5b1964ac5097a50 ] tcp_fastopen_create_child() hands the SYN packet itself to subflow_syn_recv_sock(). For an MP_JOIN request this takes the fatal fallback: the cloned child is destroyed and handed back with drop_req flagged, but tcp_fastopen_create_child() does not check the flag and queues it, so accept() can expose the freed child. MP_JOIN cannot use Fast Open: data on a subflow requires the completed HMAC exchange (RFC 8684, sec. 3.2). Refuse it (only the TFO path passes a SYN skb here) and let tcp_conn_request() fall back to the regular MP_JOIN handshake; also strip the Fast Open cookie from MP_JOIN SYN/ACKs. Fixes: 90bf45134d55 ("mptcp: add new sock flag to deal with join subflows") Cc: stable@vger.kernel.org Reported-by: Kimi Security Team Suggested-by: Jiayuan Chen Suggested-by: Paolo Abeni Signed-off-by: Yilin Zhang [ Moving code to avoid clearing TS and consolidating checks. ] Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20261030-mptcp-tfo-mpj-v4-1-e6eff2027342@kernel.org Signed-off-by: Paolo Abeni [ sashal: omitted the upstream hunk in subflow_prep_synack() that clears the Fast Open cookie for MP_JOIN, since that function doesn't exist here; only the subflow_syn_recv_sock() check was applied. ] Signed-off-by: Sasha Levin --- net/mptcp/subflow.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index b192a4d8b707c..034bc4186dc8d 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -782,6 +782,13 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, fallback = true; } else if (subflow_req->mp_join) { + /* a SYN skb here comes from TFO, which MP_JOIN cannot use: just + * fall back to the regular path. + */ + if ((TCP_SKB_CB(skb)->tcp_flags & (TCPHDR_SYN | TCPHDR_ACK)) == + TCPHDR_SYN) + return NULL; + mptcp_get_options(skb, &mp_opt); if (!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK)) fallback = true; -- 2.53.0