Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758272AbYH0QGr (ORCPT ); Wed, 27 Aug 2008 12:06:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755321AbYH0QG0 (ORCPT ); Wed, 27 Aug 2008 12:06:26 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:50747 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755387AbYH0QGY (ORCPT ); Wed, 27 Aug 2008 12:06:24 -0400 Date: Wed, 27 Aug 2008 12:06:23 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: Greg KH , , Stefan Kopp , Marcel Janssen , Felipe Balbi , Subject: Re: [PATCH] USB: add USB test and measurement class driver In-Reply-To: <200808271008.25779.oliver@neukum.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 706 Lines: 26 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/