summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-12-21 19:18:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 13:03:43 +0300
commit7be5c25e31556f44bf7c4a2079184dcc93768c5d (patch)
treee17ba5ee0fedeaf26d446b23f3635a1dacb68a64 /security
parent6c1d0447bf0d24e92def34cb429e967bd6fed131 (diff)
downloadlinux-7be5c25e31556f44bf7c4a2079184dcc93768c5d.tar.xz
block: fix error unwinding in device_add_disk
[ Upstream commit 99d8690aae4b2f0d1d90075de355ac087f820a66 ] One device_add is called disk->ev will be freed by disk_release, so we should free it twice. Fix this by allocating disk->ev after device_add so that the extra local unwinding can be removed entirely. Based on an earlier patch from Tetsuo Handa. Reported-by: syzbot <syzbot+28a66a9fbc621c939000@syzkaller.appspotmail.com> Tested-by: syzbot <syzbot+28a66a9fbc621c939000@syzkaller.appspotmail.com> Fixes: 83cbce9574462c6b ("block: add error handling for device_add_disk / add_disk") Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20211221161851.788424-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions