[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160115025943.GA11203@bbox>
Date: Fri, 15 Jan 2016 11:59:43 +0900
From: Minchan Kim <minchan@...nel.org>
To: Jerome Marchand <jmarchan@...hat.com>
CC: Nitin Gupta <ngupta@...are.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] zram: don't call idr_remove() from zram_remove()
On Thu, Jan 14, 2016 at 02:03:47PM +0100, Jerome Marchand wrote:
> The use of idr_remove() is forbidden in the callback functions of
> idr_for_each(). It is therefore unsafe to call idr_remove in
> zram_remove().
> This patch moves the call to idr_remove() from zram_remove() to
> hot_remove_store(). In the detroy_devices() path, idrs are removed by
> idr_destroy().
> This solves an use-after-free detected by KASan.
>
> Signed-off-by: Jerome Marchand <jmarchan@...hat.com>
Acked-by: Minchan Kim <minchan@...nel.org> with Sergey's nitpick
Thanks!
Powered by blists - more mailing lists