From eb14ba731981f17d262a2ad1c4ad796f9053f2b9 Mon Sep 17 00:00:00 2001 From: yu kuai Date: Wed, 6 May 2020 15:32:36 +0800 Subject: [PATCH] blk-mq: use blk_mq_queue_tag_inflight_iter() in debugfs hulk inclusion category: bugfix bugzilla: 34280 CVE: NA --------------------------- blk_mq_tagset_busy_iter() is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter() here. Signed-off-by: yu kuai Reviewed-by: Hou Tao Signed-off-by: Yang Yingliang --- block/blk-mq-debugfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index f0865b6ea1e1..e098b79cab47 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -427,7 +427,8 @@ struct show_busy_params { * Note: the state of a request may change while this function is in progress, * e.g. due to a concurrent blk_mq_finish_request() call. */ -static void hctx_show_busy_rq(struct request *rq, void *data, bool reserved) +static void hctx_show_busy_rq(struct blk_mq_hw_ctx *hctx, + struct request *rq, void *data, bool reserved) { const struct show_busy_params *params = data; @@ -442,7 +443,7 @@ static int hctx_busy_show(void *data, struct seq_file *m) struct blk_mq_hw_ctx *hctx = data; struct show_busy_params params = { .m = m, .hctx = hctx }; - blk_mq_tagset_busy_iter(hctx->queue->tag_set, hctx_show_busy_rq, + blk_mq_queue_tag_inflight_iter(hctx->queue, hctx_show_busy_rq, ¶ms); return 0; -- GitLab