Re: [PATCH] usb: typec: tipd: fix uninitialized typec_partner_desc on stack

From: Greg KH

Date: Tue Aug 04 2026 - 02:30:49 EST


On Mon, Aug 03, 2026 at 10:45:21PM +0530, Radhey Shyam Pandey wrote:
> tps6598x_connect() and cd321x_update_work() pass 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: 82432bbfb9e8 ("usb: typec: tipd: Handle mode transitions for CD321x")
> Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xxxxxxx>
> ---
> AI code scanning identified this issue; the possible call graph is shown below.

Nice, then please use an Assisted-by: tag.

thanks,

greg k-h