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 713664E73DF; Fri, 9 Oct 2026 14:41:45 +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=1791556906; cv=none; b=QSv9LS3Yp+8ZYDk4fcN2awaon+Ux5AkKYM9SdpGY7G2y+hxButVrl+WjWPTkhrsIaV01yd5p7/BobwxwqxRl58R9ZoxK/bYfJH16rr6dsc0PmmnHnziE6mxRV5/gOsrxTenaPWpP1jm2paYqC78PYuEmRIVrMk3pIy6gvuB57TU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791556906; c=relaxed/simple; bh=47+Ez+N3DQ/sR/ee98zaECkoaoDv7sqCxpi9q6DbbVc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lDKEzhyS6DpKZjKU5BpXAHWL/E37U84MwB60URAvKpMvgFwUNdrgQuR+OojljvPA/51M3QTXXSYJKD0f9nsSV4pdvHlaxnTVimtE+hZNfFxumH03JiWWWbJfWEbkQiMzE+YCSD4mIKHSYrsI5VhyKB3w2Hl0FfJxG3Dh5lvIZlQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HLuwxL+4; 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="HLuwxL+4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C48B31F00893; Fri, 9 Oct 2026 14:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791556905; bh=EZuhN+75EgkV2D1MHy352u1A7wdmkerw/XStcZ5WihE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HLuwxL+4yPF40TSOQP6iJ/pu0sDCO5uuWhGigYWE9YM467+mSAgyDi5k20k1SNyHk 4qfDu1HaP5evwcJPDEPmKdOsE9cCAoZeCHEBSqvSs1rGyQrv4Ewj5ROijMisFhoyP5 fyvcYLKpdTsJLfwlwx0efoSQUxxFfw7Iu1hEjcgY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Heikki Krogerus , Radhey Shyam Pandey , stable Subject: [PATCH 7.2 229/428] usb: typec: tipd: fix uninitialized typec_partner_desc in tps6598x_connect() Date: Fri, 9 Oct 2026 16:09:26 +0200 Message-ID: <20261009140951.142864549@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261009140946.008206689@linuxfoundation.org> References: <20261009140946.008206689@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Radhey Shyam Pandey commit c4b27b3605788bbf9e4251f3cd4ab94645ab036f upstream. tps6598x_connect() passes a stack-allocated typec_partner_desc to typec_register_partner() after initializing only usb_pd, accessory and identity. typec_register_partner() copies attach and deattach from the descriptor into the partner. With those fields left unset, garbage function pointers may be stored and later invoked from typec_partner_link_device() when a USB device is linked to the port. Uninitialized pd_revision and usb_capability similarly leak stack data through partner sysfs. Zero-initialize the descriptor so optional callbacks remain NULL and the remaining fields are zero. Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers") Cc: stable # 5.15+ Reviewed-by: Heikki Krogerus Signed-off-by: Radhey Shyam Pandey Link: https://patch.msgid.link/20260906131942.83153-2-radhey.shyam.pandey@amd.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/tipd/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -340,7 +340,7 @@ static void tps6598x_set_data_role(struc static int tps6598x_connect(struct tps6598x *tps, u32 status) { - struct typec_partner_desc desc; + struct typec_partner_desc desc = { }; enum typec_pwr_opmode mode; int ret; @@ -351,7 +351,6 @@ static int tps6598x_connect(struct tps65 desc.usb_pd = mode == TYPEC_PWR_MODE_PD; desc.accessory = TYPEC_ACCESSORY_NONE; /* XXX: handle accessories */ - desc.identity = NULL; if (desc.usb_pd) { ret = tps6598x_read_partner_identity(tps);