Re: [PATCH] USB: add USB test and measurement class driver

Alan Stern
2008-08-27T16:06:47Z

On Wed, 27 Aug 2008, Oliver Neukum wrote:

> This is a race condition.
>
> CPU A CPU B
> open()
> usb_find_interface()
> disconnect()
> kref_put()
> usbtmc_delete()
> kfree()
> kref_get()
>
> You can write to free memory. You must use a static mutex for
> mutual exclusion between open() and disconnect()

Is that necessary? usbcore includes its own mutual exclusion now.
Look in file.c at how minor_rwsem is used.

Alan Stern