public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Jerome Marchand <jmarchan@redhat.com>
Cc: Nitin Gupta <ngupta@vflare.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] zram: don't call idr_remove() from zram_remove()
Date: Fri, 15 Jan 2016 11:59:43 +0900	[thread overview]
Message-ID: <20160115025943.GA11203@bbox> (raw)
In-Reply-To: <1452776627-21662-1-git-send-email-jmarchan@redhat.com>

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@redhat.com>

Acked-by: Minchan Kim <minchan@kernel.org> with Sergey's nitpick

Thanks!
 

      parent reply	other threads:[~2016-01-15  2:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 13:03 [PATCH] zram: don't call idr_remove() from zram_remove() Jerome Marchand
2016-01-15  0:43 ` Sergey Senozhatsky
2016-01-15  1:25   ` Sergey Senozhatsky
2016-01-15  2:59 ` Minchan Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160115025943.GA11203@bbox \
    --to=minchan@kernel.org \
    --cc=jmarchan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ngupta@vflare.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox