[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160825073826.GB18622@lst.de>
Date: Thu, 25 Aug 2016 09:38:26 +0200
From: Christoph Hellwig <hch@....de>
To: Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc: Jens Axboe <axboe@...com>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org,
Maxim Patlasov <mpatlasov@...tuozzo.com>,
Christoph Hellwig <hch@....de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs/block_dev: fix potential NULL ptr deref in
freeze_bdev()
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@...tuozzo.com>
Looks fine,
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists