Re: Manual unbind of ATA devices causes use-after-free

2017-11-13 Thread Tejun Heo
Hello, On Mon, Nov 13, 2017 at 12:09:27PM -0800, Taras Kondratiuk wrote: > > cc'ing Lin. Lin, can you take a look at this? > > I'm ready to test whenever you have something. If you don't have time to > look at this then can you recommend a proper way to fix it. Is it better > to change device hi

Re: Manual unbind of ATA devices causes use-after-free

2017-11-13 Thread Taras Kondratiuk
Hi Lin, Quoting Tejun Heo (2017-11-06 07:24:52) > Hello, > > On Fri, Nov 03, 2017 at 09:32:16AM -0700, Taras Kondratiuk wrote: > > Also even if sg_release() is called before ata_host_release() there is > > still no guarantee that the last reference will be dropped, because > > sg_release() schedu

Re: Manual unbind of ATA devices causes use-after-free

2017-11-06 Thread Tejun Heo
Hello, On Fri, Nov 03, 2017 at 09:32:16AM -0700, Taras Kondratiuk wrote: > Quoting Tejun Heo (2017-11-03 06:19:37) > > Hello, > > > > On Wed, Nov 01, 2017 at 04:24:47PM -0700, Taras Kondratiuk wrote: > > > Manual unbind/remove unconditionally invokes devres_release_all which > > > calls ata_host_

Re: Manual unbind of ATA devices causes use-after-free

2017-11-03 Thread Taras Kondratiuk
Quoting Tejun Heo (2017-11-03 06:19:37) > Hello, > > On Wed, Nov 01, 2017 at 04:24:47PM -0700, Taras Kondratiuk wrote: > > Manual unbind/remove unconditionally invokes devres_release_all which > > calls ata_host_release() and frees ata_host/ata_port memory while it is > > still being referenced (e

Re: Manual unbind of ATA devices causes use-after-free

2017-11-03 Thread Tejun Heo
Hello, On Wed, Nov 01, 2017 at 04:24:47PM -0700, Taras Kondratiuk wrote: > Manual unbind/remove unconditionally invokes devres_release_all which > calls ata_host_release() and frees ata_host/ata_port memory while it is > still being referenced (e.g as a parent of SCSI host). > > Is there a reason