diff options
author | Ming Lei <ming.lei@redhat.com> | 2018-01-06 16:27:40 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-13 19:48:11 +0200 |
commit | 3bab65f29e6bf4615519b1e6dba5684cc8b53a72 (patch) | |
tree | ffd75d4bd04fcf025d6ef1b198f7dc1bcb6a9417 /drivers/video | |
parent | 5736369b54e3a4dc00592df922fbd8d739fb5be2 (diff) |
blk-mq: fix race between updating nr_hw_queues and switching io sched
[ Upstream commit fb350e0ad99359768e1e80b4784692031ec340e4 ]
In both elevator_switch_mq() and blk_mq_update_nr_hw_queues(), sched tags
can be allocated, and q->nr_hw_queue is used, and race is inevitable, for
example: blk_mq_init_sched() may trigger use-after-free on hctx, which is
freed in blk_mq_realloc_hw_ctxs() when nr_hw_queues is decreased.
This patch fixes the race be holding q->sysfs_lock.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/video')
0 files changed, 0 insertions, 0 deletions