diff options
author | Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> | 2022-03-08 09:09:15 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-03-09 01:48:39 +0100 |
commit | 0a5aa8d161d19a1b12fd25b434b32f7c885c73bb (patch) | |
tree | c210cb834f618202ce257ca3085992afe4d5ed5a /block/blk-core.c | |
parent | blktrace: fix use after free for struct blk_trace (diff) | |
download | linux-0a5aa8d161d19a1b12fd25b434b32f7c885c73bb.tar.xz linux-0a5aa8d161d19a1b12fd25b434b32f7c885c73bb.zip |
block: fix blk_mq_attempt_bio_merge and rq_qos_throttle protection
Commit 9d497e2941c3 ("block: don't protect submit_bio_checks by
q_usage_counter") moved blk_mq_attempt_bio_merge and rq_qos_throttle
calls out of q_usage_counter protection. However, these functions require
q_usage_counter protection. The blk_mq_attempt_bio_merge call without
the protection resulted in blktests block/005 failure with KASAN null-
ptr-deref or use-after-free at bio merge. The rq_qos_throttle call
without the protection caused kernel hang at qos throttle.
To fix the failures, move the blk_mq_attempt_bio_merge and
rq_qos_throttle calls back to q_usage_counter protection.
Fixes: 9d497e2941c3 ("block: don't protect submit_bio_checks by q_usage_counter")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20220308080915.3473689-1-shinichiro.kawasaki@wdc.com
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
0 files changed, 0 insertions, 0 deletions