linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Jens Axboe <axboe@fb.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	Maxim Patlasov <mpatlasov@virtuozzo.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/block_dev: fix potential NULL ptr deref in freeze_bdev()
Date: Thu, 25 Aug 2016 09:38:26 +0200	[thread overview]
Message-ID: <20160825073826.GB18622@lst.de> (raw)
In-Reply-To: <1471967731-3465-1-git-send-email-aryabinin@virtuozzo.com>

On Tue, Aug 23, 2016 at 06:55:31PM +0300, Andrey Ryabinin wrote:
> Calling freeze_bdev() twice on the same block device without mounted
> filesystem get_super() will return NULL, which will lead to NULL-ptr
> dereference later in drop_super().
> 
> Check get_super() result to fix that.
> 
> Note, that this is a purely theoretical issue. We have only 3
> freeze_bdev() callers. 2 of them are in filesystem code and used on a
> device with mounted fs. The third one in lock_fs() has protection in
> upper-layer code against freezing block device the second time without
> thawing it first.
> 
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2016-08-25  7:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 15:55 [PATCH] fs/block_dev: fix potential NULL ptr deref in freeze_bdev() Andrey Ryabinin
2016-08-25  7:38 ` Christoph Hellwig [this message]
2016-08-25 14:38 ` Jens Axboe
2016-08-25 14:39 ` Jens Axboe

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=20160825073826.GB18622@lst.de \
    --to=hch@lst.de \
    --cc=aryabinin@virtuozzo.com \
    --cc=axboe@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatlasov@virtuozzo.com \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).