summaryrefslogtreecommitdiff
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2025-09-23 15:01:01 +0800
committerJens Axboe <axboe@kernel.dk>2025-09-23 01:35:52 -0600
commit670bfe683850cb29957a9d71f997e9774eb24de6 (patch)
tree09ea5172b2f505a5e2eae44e1e8c2e2b7c19bdfa /block/blk-mq.c
parentfea55691aca1edf2fe612fd75536ec26354a8c4a (diff)
blk-mq: fix null-ptr-deref in blk_mq_free_tags() from error path
blk_mq_free_tags() can be called after blk_mq_init_tags(), while tags->page_list is still not initialized, causing null-ptr-deref. Fix this problem by initializing tags->page_list at blk_mq_init_tags(), meanwhile, also free tags directly from error path because there is no srcu barrier. Fixes: ad0d05dbddc1 ("blk-mq: Defer freeing of tags page_list to SRCU callback") Reported-by: syzbot+5c5d41e80248d610221f@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/68d1b079.a70a0220.1b52b.0000.GAE@google.com/ Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4ccf11cadf8c..09f579414161 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3582,8 +3582,6 @@ static int blk_mq_alloc_rqs(struct blk_mq_tag_set *set,
if (node == NUMA_NO_NODE)
node = set->numa_node;
- INIT_LIST_HEAD(&tags->page_list);
-
/*
* rq_size is the size of the request plus driver payload, rounded
* to the cacheline size