Re: [PATCH] driver core: access dev->driver under dev->mutex in dev_uevent

2015-01-19 Thread Ashish Sangwan
On Thu, Jan 15, 2015 at 2:16 AM, Greg Kroah-Hartman wrote: > On Wed, Jan 14, 2015 at 11:40:54PM +0530, ashishsangw...@gmail.com wrote: >> From: Ashish Sangwan >> >> We have hit a race condition while parallely accessing device's uevent >> and rmmoding device's driver. > > How are you doing that?

Re: [PATCH] driver core: access dev->driver under dev->mutex in dev_uevent

2015-01-14 Thread Greg Kroah-Hartman
On Wed, Jan 14, 2015 at 11:40:54PM +0530, ashishsangw...@gmail.com wrote: > From: Ashish Sangwan > > We have hit a race condition while parallely accessing device's uevent > and rmmoding device's driver. How are you doing that? By reading the uevent file and removing the device? Removing a ker

[PATCH] driver core: access dev->driver under dev->mutex in dev_uevent

2015-01-14 Thread ashishsangwan2
From: Ashish Sangwan We have hit a race condition while parallely accessing device's uevent and rmmoding device's driver. In dev_uevent() first dev->driver is checked if present which becomes true but before calling add_uevent_var dev->driver is set to NULL and driver is freed in __device_releas