> So, comments anyone?  Is the locking here all done properly?

No, it's got a problem that's also found in the 2.5.39 code
(as I happened to notice).  See excerpts below ... all paths
through the code should agree on this!

I suspect there should just be a lock guarding access to the
driver bound to that interface (semaphore may be appropriate),
where the enumeration code that modifies those bindings is
the only thing that needs to know about a policy of using BKL.

- Dave


> +     /* disconnect kernel driver from interface, leaving it unbound */
> +     case USBDEVFS_DISCONNECT:
> +             driver = ifp->driver;
> +             if (driver) {
> +                     down (&driver->serialize);

... does NOT use BKL to protect against module unload ...

> +       /* talk directly to the interface's driver */
> +       default:
> +             lock_kernel(); /* against module unload */
> +               driver = ifp->driver;

... DOES use BKL to protect against unload (or anyone enumerating
this interface)





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to