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: edb0872f ("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>
Showing
- block/bfq-iosched.c 1 addition, 1 deletionblock/bfq-iosched.c
- block/blk-cgroup.c 2 additions, 2 deletionsblock/blk-cgroup.c
- block/blk-mq.c 1 addition, 1 deletionblock/blk-mq.c
- block/blk-settings.c 4 additions, 4 deletionsblock/blk-settings.c
- block/blk-sysfs.c 6 additions, 7 deletionsblock/blk-sysfs.c
- block/blk-wbt.c 5 additions, 5 deletionsblock/blk-wbt.c
- block/genhd.c 2 additions, 0 deletionsblock/genhd.c
- include/linux/blkdev.h 2 additions, 3 deletionsinclude/linux/blkdev.h
- include/trace/events/kyber.h 3 additions, 3 deletionsinclude/trace/events/kyber.h
Please register or sign in to comment