[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180313202938.GI2943022@devbig577.frc2.facebook.com>
Date: Tue, 13 Mar 2018 13:29:38 -0700
From: Tejun Heo <tj@...nel.org>
To: Taras Kondratiuk <takondra@...co.com>
Cc: Lin Ming <minggr@...il.com>, xe-linux-external@...co.com,
linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] libata: add refcounting to ata_host
On Fri, Mar 09, 2018 at 08:34:41AM +0000, Taras Kondratiuk wrote:
> After commit 9a6d6a2ddabb ("ata: make ata port as parent device of scsi
> host") manual driver unbind/remove causes use-after-free.
>
> Unbind unconditionally invokes devres_release_all() which calls
> ata_host_release() and frees ata_host/ata_port memory while it is still
> being referenced as a parent of SCSI host. When SCSI host is finally
> released scsi_host_dev_release() calls put_device(parent) and accesses
> freed ata_port memory.
>
> Add reference counting to make sure that ata_host lives long enough.
>
> Bug report: https://lkml.org/lkml/2017/11/1/945
> Fixes: 9a6d6a2ddabb ("ata: make ata port as parent device of scsi host")
> Cc: Tejun Heo <tj@...nel.org>
> Cc: Lin Ming <minggr@...il.com>
> Cc: linux-ide@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Taras Kondratiuk <takondra@...co.com>
Applied to libata/for-4.17.
Thanks.
--
tejun
Powered by blists - more mailing lists