Re: [PATCH v1 OPT1] driver core: Fix use-after-free and double free on glue directory

2019-07-04 Thread Benjamin Herrenschmidt
On Thu, 2019-07-04 at 07:41 +0200, Greg KH wrote: > On Thu, Jul 04, 2019 at 08:57:53AM +1000, Benjamin Herrenschmidt > wrote: > > On Wed, 2019-07-03 at 21:37 +0200, Greg KH wrote: > > > Ok, I guess I have to take this patch, as the other one is so bad > > > :) > > > > > > But, I need a very large

Re: [PATCH v1 OPT1] driver core: Fix use-after-free and double free on glue directory

2019-07-03 Thread Greg KH
On Thu, Jul 04, 2019 at 08:57:53AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2019-07-03 at 21:37 +0200, Greg KH wrote: > > Ok, I guess I have to take this patch, as the other one is so bad :) > > > > But, I need a very large comment here saying why we are poking around in > > a kref and why

Re: [PATCH v1 OPT1] driver core: Fix use-after-free and double free on glue directory

2019-07-03 Thread Benjamin Herrenschmidt
On Wed, 2019-07-03 at 21:37 +0200, Greg KH wrote: > Ok, I guess I have to take this patch, as the other one is so bad :) > > But, I need a very large comment here saying why we are poking around in > a kref and why we need to do this, at the expense of anything else. > > So can you respin this

Re: [PATCH v1 OPT1] driver core: Fix use-after-free and double free on glue directory

2019-07-03 Thread Greg KH
On Wed, Jun 26, 2019 at 10:38:23PM +0800, Muchun Song wrote: > There is a race condition between removing glue directory and adding a new > device under the glue directory. It can be reproduced in following test: > > path 1: Add the child device under glue dir > device_add() >

[PATCH v1 OPT1] driver core: Fix use-after-free and double free on glue directory

2019-06-26 Thread Muchun Song
There is a race condition between removing glue directory and adding a new device under the glue directory. It can be reproduced in following test: path 1: Add the child device under glue dir device_add() get_device_parent() mutex_lock(_mutex); /*find parent from