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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131216212056.GE12896@saruman.home>
Date:	Mon, 16 Dec 2013 15:20:56 -0600
From:	Felipe Balbi <balbi@...com>
To:	Apelete Seketeli <apelete@...eteli.net>
CC:	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Felipe Balbi <balbi@...com>,
	Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH 3/3] usb: musb: fix setting JZ4740 gadget periphal mode
 on reset

On Sat, Dec 14, 2013 at 04:48:38AM +0100, Apelete Seketeli wrote:
> JZ4740 USB Device Controller is not OTG compatible and does not have DEVCTL
> register in silicon.
> 
> During ethernet-over-usb transactions, on reset, musb driver tries to
> read from DEVCTL and consequently sets device as host (A-Device)
> instead of peripheral (B-Device), which makes it a composite device to
> the USB gadget driver.
> This induces a kernel panic during power down where the USB gadget
> driver does a null pointer dereference when trying to access the
> composite device configuration.
> 
> On reset, do not rely on DEVCTL value for setting gadget peripheral
> mode: hardcode it instead to B-Device.
> 
> Signed-off-by: Apelete Seketeli <apelete@...eteli.net>
> ---
>  drivers/usb/musb/musb_gadget.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index 32fb057..b4bea7a 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -2119,6 +2119,14 @@ __acquires(musb->lock)
>  	/* Normal reset, as B-Device;
>  	 * or else after HNP, as A-Device
>  	 */
> +#if defined(CONFIG_USB_MUSB_JZ4740) || defined(CONFIG_USB_MUSB_JZ4740_MODULE)

NAK, no ifdefs in this driver. Pass a quirk flag through platform_data
or something similar.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ