diff options
author | Coly Li <colyli@suse.de> | 2021-11-03 14:49:17 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-11-03 06:00:29 -0600 |
commit | 8468f45091d2866affed6f6a7aecc20779139173 (patch) | |
tree | 8a4faac110eed648c5eba0bc2d0ecabe6360fc50 /drivers/nvdimm | |
parent | 00c5495c54f785beb0f6a34f7a3674d3ea0997d5 (diff) | |
download | linux-8468f45091d2866affed6f6a7aecc20779139173.tar.bz2 |
bcache: fix use-after-free problem in bcache_device_free()
In bcache_device_free(), pointer disk is referenced still in
ida_simple_remove() after blk_cleanup_disk() gets called on this
pointer. This may cause a potential panic by use-after-free on the
disk pointer.
This patch fixes the problem by calling blk_cleanup_disk() after
ida_simple_remove().
Fixes: bc70852fd104 ("bcache: convert to blk_alloc_disk/blk_cleanup_disk")
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: stable@vger.kernel.org # v5.14+
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211103064917.67383-1-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvdimm')
0 files changed, 0 insertions, 0 deletions