Re: [PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Tejun Heo
Alan Stern wrote: > 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 resulti

Re: [PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Alan Stern
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 a

Re: [PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Tejun Heo
Kay Sievers wrote: > On 5/10/07, Tejun Heo <[EMAIL PROTECTED]> 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 >> clos

Re: [PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Greg KH
On Thu, May 10, 2007 at 05:13:10PM +0200, Tejun Heo wrote: > Greg KH wrote: > >> 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). > > > > As I don't think we shou

Re: [PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Kay Sievers
On 5/10/07, Tejun Heo <[EMAIL PROTECTED]> 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 garbl

Re: [PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Tejun Heo
Greg KH wrote: >> 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). > > As I don't think we should be adding your sysfs rework to 2.6.22 just > yet, any objections to

Re: [PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Greg KH
On Thu, May 10, 2007 at 04:45:17PM +0200, 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

[PATCH] driver-core: don't free devt_attr till the device is released

2007-05-10 Thread Tejun Heo
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