Commit 9130a71
Ming Lei
blk-mq: fix null-ptr-deref in blk_mq_free_tags() from error path
JIRA: https://issues.redhat.com/browse/RHEL-123480
commit 670bfe6
Author: Yu Kuai <yukuai3@huawei.com>
Date: Tue Sep 23 15:01:01 2025 +0800
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: ad0d05d ("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>
Signed-off-by: Ming Lei <ming.lei@redhat.com>1 parent 8999ae3 commit 9130a71
2 files changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
572 | 574 | | |
573 | 575 | | |
574 | 576 | | |
| |||
606 | 608 | | |
607 | 609 | | |
608 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
609 | 618 | | |
610 | 619 | | |
611 | 620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3572 | 3572 | | |
3573 | 3573 | | |
3574 | 3574 | | |
3575 | | - | |
3576 | | - | |
3577 | 3575 | | |
3578 | 3576 | | |
3579 | 3577 | | |
| |||
0 commit comments