lkml.org 
[lkml]   [2008]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] USB: add USB test and measurement class driver
Date
Am Mittwoch 27 August 2008 18:06:23 schrieb Alan Stern:
> 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.

This is interesting, the driver simply doesn't unregister the device.
So it would be needed if the code could be left as it is. As not unregistering
the device is wrong, this will fix the bug.

Thanks
Oliver


\
 
 \ /
  Last update: 2008-08-27 19:07    [W:0.262 / U:0.520 seconds]
©2003-2011 Jasper Spaans. Advertise on this site