Commit 8ce6cbc4 authored by Ming Lei's avatar Ming Lei Committed by Yang Yingliang
Browse files

block: fix use-after-free in disk_part_iter_next



stable inclusion
from linux-4.19.168
commit 3d13ebbd06697e2fb180a61bbff1ff244a9513e4

--------------------------------

commit aebf5db9 upstream.

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: default avatar <syzbot+825f0f9657d4e528046e@syzkaller.appspotmail.com>
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarCheng Jian <cj.chengjian@huawei.com>
parent 631c6e0d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment