> > > where is the incrementing to the module use counters for probe() done ?
> >
> > I think I remember noticing it wasn't done:  lurking bug, worth a fix.
> >
> > It'd likely belong somewhere in the usb.c usb_find_interface_driver()
> > code; that driver->serialize semaphore doesn't do enough.
> 
> I thought so. Upon second thought I think disconnect() is vulnerable, too.

Yes.

> The fix involves adding a module field to struct usb_driver. A "module : 
> THIS_MODULE" should make any driver consisting of one module safe. Usbserial 
> needs further work.
> 
> Do you like the included patch ?

A quick browse suggested it's the right kind of thing, though
there seem to be some other changes mixed in.

A more thorough code review would compare this against
how PCI handles the very same problem.  It also initializes
the driver structures with a THIS_MODULE and prevents
probe/disconnect module races by managing the module
use counts.  PCI made this change quite a while back, as
I suspect you know.

The individual drivers will need some cleanup, at least those
which try to work around the current lack of usbcore protection
in this area.  Successful probe and disconnect routines should
now probably just increment and decrement module use counts.

- Dave




_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to