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:	Tue, 12 May 2009 22:25:57 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Jason Wessel <jason.wessel@...driver.com>
cc:	greg@...ah.com, <linux-usb@...r.kernel.org>, <oliver@...kum.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] usb hcd: poll hcd device to force writes

On Tue, 12 May 2009, Jason Wessel wrote:

> This patch takes the route of forcibly polling the hcd device to drain
> the urb queue in order to initiate the bulk write call backs.  This
> only happens if the device is a usb serial console device that sets
> the max_in_flight_urbs in the serial device structure.

> +void
> +usb_hcd_poll_urb_irq(struct urb *urb)
> +{
> +	struct usb_hcd *hcd;
> +
> +	if (!urb)
> +		return;

Is this test really needed?  The routine is called from only one spot, 
after all.  It seems more likely that urb will point to deallocated 
memory than that it will be NULL.  Do you protect against this in 
usb_do_console_write?

Maybe you should pass a pointer to a usb_bus structure rather than an
URB.  Then none of these issues would arise.

> +
> +	hcd = bus_to_hcd(urb->dev->bus);
> +	if (hcd)
> +		usb_hcd_irq(0, hcd);

This test too looks strange, since it can never fail.  (See the 
definition of bus_to_hcd to find out why...)

Alan Stern


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ