Re: [PATCH] kobject: Avoid premature parent object freeing in kobject_cleanup()

2020-08-03 Thread Greg Kroah-Hartman
On Mon, Aug 03, 2020 at 02:31:23PM +0800, Qu Wenruo wrote: > > > On 2020/6/5 上午1:46, Rafael J. Wysocki wrote: > > From: Heikki Krogerus > > > > If kobject_del() is invoked by kobject_cleanup() to delete the > > target kobject, it may cause its parent kobject to be freed > > before invoking the

Re: [PATCH] kobject: Avoid premature parent object freeing in kobject_cleanup()

2020-08-03 Thread Qu Wenruo
On 2020/8/3 下午3:27, Andy Shevchenko wrote: > On Mon, Aug 3, 2020 at 10:25 AM Andy Shevchenko > wrote: >> On Mon, Aug 3, 2020 at 9:47 AM Qu Wenruo wrote: >>> On 2020/6/5 上午1:46, Rafael J. Wysocki wrote: > +void kobject_del(struct kobject *kobj) +{ + struct kobject *parent = k

Re: [PATCH] kobject: Avoid premature parent object freeing in kobject_cleanup()

2020-08-03 Thread Andy Shevchenko
On Mon, Aug 3, 2020 at 10:25 AM Andy Shevchenko wrote: > On Mon, Aug 3, 2020 at 9:47 AM Qu Wenruo wrote: > > On 2020/6/5 上午1:46, Rafael J. Wysocki wrote: > > > +void kobject_del(struct kobject *kobj) > > > +{ > > > + struct kobject *parent = kobj->parent; > > > + > > > + __kobject_del(ko

Re: [PATCH] kobject: Avoid premature parent object freeing in kobject_cleanup()

2020-08-03 Thread Andy Shevchenko
On Mon, Aug 3, 2020 at 9:47 AM Qu Wenruo wrote: > On 2020/6/5 上午1:46, Rafael J. Wysocki wrote: ... > > +/** > > + * kobject_del() - Unlink kobject from hierarchy. > > + * @kobj: object. > > + * > > + * This is the function that should be called to delete an object > > + * successfully added via

Re: [PATCH] kobject: Avoid premature parent object freeing in kobject_cleanup()

2020-08-02 Thread Qu Wenruo
On 2020/6/5 上午1:46, Rafael J. Wysocki wrote: > From: Heikki Krogerus > > If kobject_del() is invoked by kobject_cleanup() to delete the > target kobject, it may cause its parent kobject to be freed > before invoking the target kobject's ->release() method, which > effectively means freeing the

[PATCH] kobject: Avoid premature parent object freeing in kobject_cleanup()

2020-06-04 Thread Rafael J. Wysocki
From: Heikki Krogerus If kobject_del() is invoked by kobject_cleanup() to delete the target kobject, it may cause its parent kobject to be freed before invoking the target kobject's ->release() method, which effectively means freeing the parent before dealing with the child entirely. That is con