]> git.baikalelectronics.ru Git - kernel.git/commit
block: add an explicit ->disk backpointer to the request_queue
authorChristoph Hellwig <hch@lst.de>
Mon, 16 Aug 2021 13:46:24 +0000 (15:46 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 18:54:31 +0000 (12:54 -0600)
commitd59a1790da59024b6c3dbfb940ee7b2a21c3f25a
tree31cc1a85256072b4d65d881472c2f6ace7c10178
parent5e86474e86ef9ae542a2a19404e8b630f6f95c1e
block: add an explicit ->disk backpointer to the request_queue

Replace the magic lookup through the kobject tree with an explicit
backpointer, given that the device model links are set up and torn
down at times when I/O is still possible, leading to potential
NULL or invalid pointer dereferences.

Fixes: c73c5e0d3ea0 ("block: move the bdi from the request_queue to the gendisk")
Reported-by: syzbot <syzbot+aa0801b6b32dca9dda82@syzkaller.appspotmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Link: https://lore.kernel.org/r/20210816134624.GA24234@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-iosched.c
block/blk-cgroup.c
block/blk-mq.c
block/blk-settings.c
block/blk-sysfs.c
block/blk-wbt.c
block/genhd.c
include/linux/blkdev.h
include/trace/events/kyber.h