]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix use-after-free in disk_part_iter_next
authorMing Lei <ming.lei@redhat.com>
Mon, 21 Dec 2020 04:33:35 +0000 (12:33 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 5 Jan 2021 18:35:17 +0000 (11:35 -0700)
commit2dc299f9d3c285ce0c030f1c5c4072e5e40722d1
treecbe567d6e39da630210e8b9284cfaed3db72aa91
parent8fbe2ddd8db06b50937cd1e05e1f511c4a9762e6
block: fix use-after-free in disk_part_iter_next

Make sure that bdgrab() is done on the 'block_device' instance before
referring to it for avoiding use-after-free.

Cc: <stable@vger.kernel.org>
Reported-by: syzbot+825f0f9657d4e528046e@syzkaller.appspotmail.com
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c