[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0808271203150.2498-100000@iolanthe.rowland.org>
Date: Wed, 27 Aug 2008 12:06:23 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Oliver Neukum <oliver@...kum.org>
cc: Greg KH <greg@...ah.com>, <linux-usb@...r.kernel.org>,
Stefan Kopp <stefan_kopp@...lent.com>,
Marcel Janssen <korgull@...e.nl>,
Felipe Balbi <me@...ipebalbi.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] USB: add USB test and measurement class driver
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists