lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Jan 2022 16:10:51 +0200
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Jon Hunter <jonathanh@...dia.com>
Cc:     Stephan Gerhold <stephan@...hold.net>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-tegra@...r.kernel.org
Subject: Re: [PATCH] usb: common: ulpi: Fix crash in ulpi_match()

Hi Jon,

On Fri, Jan 14, 2022 at 10:02:17AM +0000, Jon Hunter wrote:
> Commit 7495af930835 ("ARM: multi_v7_defconfig: Enable drivers for
> DragonBoard 410c") enables the CONFIG_PHY_QCOM_USB_HS for the ARM
> multi_v7_defconfig. Enabling this Kconfig is causing the kernel to crash
> on the Tegra20 Ventana platform in the ulpi_match() function.
> 
> The Qualcomm USB HS PHY driver that is enabled by CONFIG_PHY_QCOM_USB_HS,
> registers a ulpi_driver but this driver does not provide an 'id_table',
> so when ulpi_match() is called on the Tegra20 Ventana platform, it
> crashes when attempting to deference the id_table pointer which is not
> valid. The Qualcomm USB HS PHY driver uses device-tree for matching the
> ULPI driver with the device and so fix this crash by using device-tree
> for matching if the id_table is not valid.
> 
> Signed-off-by: Jon Hunter <jonathanh@...dia.com>

So is this fixing commit 7495af930835, or perhaps commit ef6a7bcfb01c
("usb: ulpi: Support device discovery via DT")?

I would assume ef6a7bcfb01c ("usb: ulpi: Support device discovery via
DT"). Please include the appropriate Fixes tag.

> ---
>  drivers/usb/common/ulpi.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
> index 4169cf40a03b..8f8405b0d608 100644
> --- a/drivers/usb/common/ulpi.c
> +++ b/drivers/usb/common/ulpi.c
> @@ -39,8 +39,11 @@ static int ulpi_match(struct device *dev, struct device_driver *driver)
>  	struct ulpi *ulpi = to_ulpi_dev(dev);
>  	const struct ulpi_device_id *id;
>  
> -	/* Some ULPI devices don't have a vendor id so rely on OF match */
> -	if (ulpi->id.vendor == 0)
> +	/*
> +	 * Some ULPI devices don't have a vendor id
> +	 * or provide an id_table so rely on OF match.
> +	 */
> +	if (ulpi->id.vendor == 0 || !drv->id_table)
>  		return of_driver_match_device(dev, driver);
>  
>  	for (id = drv->id_table; id->vendor; id++)
> -- 
> 2.25.1

thanks,

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ