From: Oliver Neukum <oliver@neukum.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
linux-usb@vger.kernel.org, Stefan Kopp <stefan_kopp@agilent.com>,
Marcel Janssen <korgull@home.nl>,
Felipe Balbi <me@felipebalbi.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: add USB test and measurement class driver
Date: Wed, 27 Aug 2008 19:05:51 +0200 [thread overview]
Message-ID: <200808271905.51825.oliver@neukum.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0808271203150.2498-100000@iolanthe.rowland.org>
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
next prev parent reply other threads:[~2008-08-27 17:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 0:05 Greg KH
2008-08-27 3:12 ` Greg KH
2008-08-27 16:36 ` Greg KH
2008-08-27 6:22 ` Marcel Janssen
2008-08-27 17:21 ` Greg KH
2008-08-27 8:08 ` Oliver Neukum
2008-08-27 15:40 ` Greg KH
2008-08-27 16:06 ` Alan Stern
2008-08-27 17:05 ` Oliver Neukum [this message]
2008-08-27 8:13 ` Oliver Neukum
2008-08-27 16:08 ` Greg KH
2008-08-27 8:56 ` Oliver Neukum
2008-08-27 15:28 ` Greg KH
2008-08-27 15:44 ` Oliver Neukum
2008-08-27 16:02 ` Greg KH
2008-08-27 16:11 ` Greg KH
2008-08-27 16:15 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200808271905.51825.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=greg@kroah.com \
--cc=korgull@home.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=me@felipebalbi.com \
--cc=stefan_kopp@agilent.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®