Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-22 Thread Li Zhong
On Thu, 2013-08-22 at 16:30 +0930, Rusty Russell wrote: > Greg KH writes: > > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > > struct kobj_type module_ktype = { > > > + .release =module_kobj_release, > > > .sysfs_ops =_sysfs_ops, > > > }; > > > > Wait, as there is no

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-22 Thread Rusty Russell
Greg KH writes: > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > struct kobj_type module_ktype = { > > + .release =module_kobj_release, > > .sysfs_ops =_sysfs_ops, > > }; > > Wait, as there is no release function here for the kobject (a different > problem), why

Re: [RFC PATCH next]module: Fix mod-mkobj.kobj potentially freed too early

2013-08-22 Thread Rusty Russell
Greg KH gre...@linuxfoundation.org writes: On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: struct kobj_type module_ktype = { + .release =module_kobj_release, .sysfs_ops =module_sysfs_ops, }; Wait, as there is no release function here for the kobject (a

Re: [RFC PATCH next]module: Fix mod-mkobj.kobj potentially freed too early

2013-08-22 Thread Li Zhong
On Thu, 2013-08-22 at 16:30 +0930, Rusty Russell wrote: Greg KH gre...@linuxfoundation.org writes: On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: struct kobj_type module_ktype = { + .release =module_kobj_release, .sysfs_ops =module_sysfs_ops, }; Wait, as

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
On Wed, 2013-08-21 at 21:03 -0700, Greg KH wrote: > On Thu, Aug 22, 2013 at 10:34:06AM +0800, Li Zhong wrote: > > On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: > > > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > > > DEBUG_KOBJECT_RELEASE helps to find the issue attached below.

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Greg KH
On Thu, Aug 22, 2013 at 10:34:06AM +0800, Li Zhong wrote: > On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: > > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > > DEBUG_KOBJECT_RELEASE helps to find the issue attached below. > > > > > > After some investigation, it seems the reason

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: > On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > > DEBUG_KOBJECT_RELEASE helps to find the issue attached below. > > > > After some investigation, it seems the reason is: > > The mod->mkobj.kobj(a01600d0 below) is freed

Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Greg KH
On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: > DEBUG_KOBJECT_RELEASE helps to find the issue attached below. > > After some investigation, it seems the reason is: > The mod->mkobj.kobj(a01600d0 below) is freed together with mod > itself in free_module(). However, its children

[RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
DEBUG_KOBJECT_RELEASE helps to find the issue attached below. After some investigation, it seems the reason is: The mod->mkobj.kobj(a01600d0 below) is freed together with mod itself in free_module(). However, its children still hold references to it, as the delay caused by

[RFC PATCH next]module: Fix mod-mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
DEBUG_KOBJECT_RELEASE helps to find the issue attached below. After some investigation, it seems the reason is: The mod-mkobj.kobj(a01600d0 below) is freed together with mod itself in free_module(). However, its children still hold references to it, as the delay caused by

Re: [RFC PATCH next]module: Fix mod-mkobj.kobj potentially freed too early

2013-08-21 Thread Greg KH
On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: DEBUG_KOBJECT_RELEASE helps to find the issue attached below. After some investigation, it seems the reason is: The mod-mkobj.kobj(a01600d0 below) is freed together with mod itself in free_module(). However, its children still

Re: [RFC PATCH next]module: Fix mod-mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: DEBUG_KOBJECT_RELEASE helps to find the issue attached below. After some investigation, it seems the reason is: The mod-mkobj.kobj(a01600d0 below) is freed together with

Re: [RFC PATCH next]module: Fix mod-mkobj.kobj potentially freed too early

2013-08-21 Thread Greg KH
On Thu, Aug 22, 2013 at 10:34:06AM +0800, Li Zhong wrote: On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: DEBUG_KOBJECT_RELEASE helps to find the issue attached below. After some investigation, it seems the reason is: The

Re: [RFC PATCH next]module: Fix mod-mkobj.kobj potentially freed too early

2013-08-21 Thread Li Zhong
On Wed, 2013-08-21 at 21:03 -0700, Greg KH wrote: On Thu, Aug 22, 2013 at 10:34:06AM +0800, Li Zhong wrote: On Wed, 2013-08-21 at 09:18 -0700, Greg KH wrote: On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote: DEBUG_KOBJECT_RELEASE helps to find the issue attached below.