blk-mq-sched: Don't reference queue tagset in blk_mq_sched_tags_teardown()
PATCH 1/1 blk-mq-sched: Don't reference queue tagset in blk_mq_sched_tags_teardown()
We should not reference the queue tagset in blk_mq_sched_tags_teardown() (see function comment) for the blk-mq flags, so use the passed flags instead.
This solves a use-after-free, similarly fixed earlier (and since broken again) in commit f0c1c4d2864e ("blk-mq: fix use-after-free in blk_mq_exit_sched").
block/blk-mq-sched.c +1 -1
@@ -541,7 +541,7 @@ static void blk_mq_sched_tags_teardown(struct request_queue *q, unsigned int flaqueue_for_each_hw_ctx (q, hctx, i) {if (hctx->sched_tags) { -if (!blk_mq_is_shared_tags (q->tag_set->flags)) +if (!blk_mq_is_shared_tags (flags))blk_mq_free_rq_map (hctx->sched_tags); hctx->sched_tags =NULL ; }
Signature · 1 line
2.17.1
Quoted 9 lines · John Garry
We should not reference the queue tagset in
blk_mq_sched_tags_teardown()(see function comment) for the blk-mq flags, so use the passed flags instead.This solves a use-after-free, similarly fixed earlier (and since broken again) in commit
f0c1c4d2864e("blk-mq: fix use-after-free inblk_mq_exit_sched").[...]
Applied, thanks!
[1/1] blk-mq-sched: Don't reference queue tagset in blk_mq_sched_tags_teardown()
commit: 8bdf7b3fe1f48a2c1c212d4685903bba01409c0e
Best regards,
Signature · 1 line
Jens Axboe