Re: [PATCH v3 3/4] usbcore/driver: Fix incorrect downcast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 25, 2020 at 07:31:44PM +0300, M. Vefa Bicakci wrote:
> On 9/25/20 5:51 PM, Greg Kroah-Hartman wrote:
> > On Tue, Sep 22, 2020 at 02:07:02PM +0300, M. Vefa Bicakci wrote:
> > > This commit resolves a minor bug in the selection/discovery of more
> > > specific USB device drivers for devices that are currently bound to
> > > generic USB device drivers.
> > > 
> > > The bug is related to the way a candidate USB device driver is
> > > compared against the generic USB device driver. The code in
> > > is_dev_usb_generic_driver() assumes that the device driver in question
> > > is a USB device driver by calling to_usb_device_driver(dev->driver)
> > > to downcast; however I have observed that this assumption is not always
> > > true, through code instrumentation.
> > > 
> > > This commit avoids the incorrect downcast altogether by comparing
> > > the USB device's driver (i.e., dev->driver) to the generic USB
> > > device driver directly. This method was suggested by Alan Stern.
> > > 
> > > This bug was found while investigating Andrey Konovalov's report
> > > indicating usbip device driver misbehaviour with the recently merged
> > > generic USB device driver selection feature. The report is linked
> > > below.
> > > 
> > > Fixes: d5643d2249 ("USB: Fix device driver race")
> > 
> > Nit, this should have been:
> > 	Fixes: d5643d2249b2 ("USB: Fix device driver race")
> > 
> > I'll go fix it up as my scripts are rejecting it as-is...
> 
> Noted; sorry for missing this. I will use 12 characters from now on.

No worries.  There's a nice git configuration line you can do that is
documented in the submitting patches file in the kernel documentation
directory, if you want to use that.  I have a alias that does it easily
as well as it gets annoying to have to type:

	git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n"

A lot :)

> I also wanted to thank you for committing the patches.

Thanks for fixing this all up!

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux