From mboxrd@z Thu Jan 1 00:00:00 1970 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 8297537C106; Fri, 4 Sep 2026 05:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501043; cv=none; b=bnriyLjJzmXjq1dyzG2pMiQW5hZi68Sj9g/vOExj5rVaQbUwxJMgzvmZf0kRx+CPA3BDVPQlLDGc3evbCLEa4FAievq5HD2/Rp/f+Wss50P1O/cxFVK0nyXsh4KHfVgOdgfh74JHSfzIGRMmLwAwso3y2cjLr2ZgptnZzcMVk2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501043; c=relaxed/simple; bh=ABVRpiwtbndl9NL3DlMLhTqk/CtFOlJwIyxr4dQZx7s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uxwHkJyj1WmvhvKVkb5CdicpKr6hZLQOo0F3Vgie//m4xtiiu+lJGAjp9fFe3ZDhD9vtBMK1H4YC3AoAlJ41UNbsD2RDFyb5NMLdGjBJQylue5S1BZbDeSz+1xVoUTtMhDCIr1HPRqXfJvPrqAiSVmJ63HQoPh3YYdCqnuaN3vc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=t89+hHP4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="t89+hHP4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA3E21F00A3D; Fri, 4 Sep 2026 05:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788501042; bh=MOUryWweQcnj2GtkRHYsReHa/zgvmWV7Q0Dwn1nkqFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=t89+hHP4O5WcwUgErbC5qbUYIsL7QnJR6eYfHAN085CwCefsIVcGfMbU3ILGClTzb D+DCthgQoefN9bijCz0c7yLSFGU8bJHjFJ5qC2z3etlULDya2tHOko1Jb8NE4un0/X k7wQxb8fiIlpuKJLuQVaiNuZ86VOyG09SG5J/G24= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Harshit Varu , "Matthieu Baerts (NGI0)" , Jakub Kicinski Subject: [PATCH 6.18 271/552] mptcp: fix uninitialized local_id in syncookie MP_JOIN reconstruction Date: Fri, 4 Sep 2026 06:57:08 +0200 Message-ID: <20260904045756.121723113@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045747.813364717@linuxfoundation.org> References: <20260904045747.813364717@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Harshit Varu commit b878dfdd12d7a5b8722a78d35e313506140ca3d9 upstream. mptcp_token_join_cookie_init_state() restores remote_nonce, local_nonce, backup, join_id, token and msk from the saved cookie entry when rebuilding the request socket for a MP_JOIN 4th-ACK handled under SYN cookies, but it does not restore local_id, even though the SYN path saved it. subflow_ulp_clone() then reads that uninitialized field and stores it as the joined subflow's address-ID. Because the request-sock slab is SLAB_TYPESAFE_BY_RCU and not zeroed on allocation, the value is the stale byte of a previously freed request socket, which an off-path peer can influence by sending concurrent MP_JOIN SYNs. This corrupts the path manager's id-based subflow bookkeeping for the connection. Restore subflow_req->local_id from the cookie entry, as done for the other fields. Fixes: 9466a1ccebbe ("mptcp: enable JOIN requests even if cookies are in use") Cc: stable@vger.kernel.org Signed-off-by: Harshit Varu Reviewed-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260815115205.197151-1-harshitvaru666@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/mptcp/syncookies.c | 1 + 1 file changed, 1 insertion(+) --- a/net/mptcp/syncookies.c +++ b/net/mptcp/syncookies.c @@ -118,6 +118,7 @@ bool mptcp_token_join_cookie_init_state( subflow_req->local_nonce = e->local_nonce; subflow_req->backup = e->backup; subflow_req->remote_id = e->join_id; + subflow_req->local_id = e->local_id; subflow_req->token = e->token; subflow_req->msk = msk; spin_unlock_bh(&join_entry_locks[i]);