Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760724AbXEJPwk (ORCPT ); Thu, 10 May 2007 11:52:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755553AbXEJPwd (ORCPT ); Thu, 10 May 2007 11:52:33 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:58694 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754788AbXEJPwd (ORCPT ); Thu, 10 May 2007 11:52:33 -0400 Date: Thu, 10 May 2007 11:52:32 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Tejun Heo cc: Greg KH , Chris Rankin , , linux-kernel , Subject: Re: [PATCH] driver-core: don't free devt_attr till the device is released In-Reply-To: <46432FFD.1040304@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1220 Lines: 30 On Thu, 10 May 2007, Tejun Heo wrote: > Currently, devt_attr for the "dev" file is freed immediately on device > removal, but if the "dev" sysfs file is open when a device is removed, > sysfs will access its attribute structure for further access including > close resulting in jumping to garbled address. Fix it by postponing > freeing devt_attr to device release time. > > Note that devt_attr for class_device is already freed on release. > > This bug is reported by Chris Rankin as bugzilla bug#8198. > > Signed-off-by: Tejun Heo > Cc: Chris Rankin > --- > Applies well to 2.6.20 and 21. As sysfs-immediate-disconnect doesn't > seem to be included in 2.6.22, this should be included in linus#master > too (applies well there as well). Although sysfs-immediate-disconnect may not be included in 2.6.22, the old attribute-orphan code by Oliver Neukum is present there and also in 2.6.21. Shouldn't that suffice? 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/