WSL2-Linux-Kernel/block
Yu Kuai e2f2a39452 block, bfq: fix uaf for 'stable_merge_bfqq'
Before commit fd571df0ac ("block, bfq: turn bfqq_data into an array
in bfq_io_cq"), process reference is read before bfq_put_stable_ref(),
and it's safe if bfq_put_stable_ref() put the last reference, because
process reference will be 0 and 'stable_merge_bfqq' won't be accessed
in this case. However, the commit changed the order and  will cause
uaf for 'stable_merge_bfqq'.

In order to emphasize that bfq_put_stable_ref() can drop the last
reference, fix the problem by moving bfq_put_stable_ref() to the end of
bfq_setup_stable_merge().

Fixes: fd571df0ac ("block, bfq: turn bfqq_data into an array in bfq_io_cq")
Reported-and-tested-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/linux-block/20230307071448.rzihxbm4jhbf5krj@shindev/
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-03-08 07:34:50 -07:00
..
partitions
Kconfig
Kconfig.iosched
Makefile
badblocks.c
bdev.c
bfq-cgroup.c for-6.3/block-2023-02-16 2023-02-20 14:27:21 -08:00
bfq-iosched.c block, bfq: fix uaf for 'stable_merge_bfqq' 2023-03-08 07:34:50 -07:00
bfq-iosched.h block, bfq: cleanup 'bfqg->online' 2023-02-07 10:20:59 -07:00
bfq-wf2q.c
bio-integrity.c block: bio-integrity: Copy flags when bio_integrity_payload is cloned 2023-02-16 11:05:41 -07:00
bio.c block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c Revert "blk-cgroup: pin the gendisk in struct blkcg_gq" 2023-02-14 14:24:09 -07:00
blk-cgroup-rwstat.h
blk-cgroup.c for-6.3/block-2023-02-16 2023-02-20 14:27:21 -08:00
blk-cgroup.h Revert "blk-cgroup: pin the gendisk in struct blkcg_gq" 2023-02-14 14:24:09 -07:00
blk-core.c block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
blk-crypto-fallback.c
blk-crypto-internal.h
blk-crypto-profile.c
blk-crypto-sysfs.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
blk-crypto.c
blk-flush.c
blk-ia-ranges.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
blk-integrity.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
blk-ioc.c
blk-iocost.c blk-iocost: Pass gendisk to ioc_refresh_params 2023-02-28 05:51:19 -07:00
blk-iolatency.c Revert "blk-cgroup: pin the gendisk in struct blkcg_gq" 2023-02-14 14:24:09 -07:00
blk-ioprio.c
blk-ioprio.h
blk-lib.c
blk-map.c 46 fs/cifs (smb3 client) changesets, 37 in fs/cifs and 9 for related helper functions and cleanup outside from Dave Howells and Willy 2023-02-22 17:12:44 -08:00
blk-merge.c block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: correct stale comment of .get_budget 2023-02-06 09:22:29 -07:00
blk-mq-sched.h
blk-mq-sysfs.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
blk-mq.h
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c
blk-stat.c
blk-stat.h
blk-sysfs.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
blk-throttle.c Revert "blk-cgroup: pin the gendisk in struct blkcg_gq" 2023-02-14 14:24:09 -07:00
blk-throttle.h
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c block: remove more NULL checks after bdev_get_queue() 2023-02-21 09:23:22 -07:00
blk.h blk-mq: enforce op-specific segment limits in blk_insert_cloned_request 2023-03-02 21:00:20 -07:00
bounce.c
bsg-lib.c
bsg.c
disk-events.c
elevator.c block: make kobj_type structures constant 2023-02-09 09:38:16 -07:00
elevator.h
fops.c
genhd.c block: fix wrong mode for blkdev_put() from disk_scan_partitions() 2023-03-07 07:24:38 -07:00
holder.c
ioctl.c block: fix scan partition for exclusively open device again 2023-02-17 06:15:57 -07:00
ioprio.c
kyber-iosched.c
mq-deadline.c
opal_proto.h
sed-opal.c sed-opal: add support flag for SUM in status ioctl 2023-02-17 06:15:53 -07:00
t10-pi.c