Commit b600de2
block, bfq: fix uaf for bfqq in bic_set_bfqq()
After commit 64dc8c7 ("block, bfq: fix possible uaf for 'bfqq->bic'"),
bic->bfqq will be accessed in bic_set_bfqq(), however, in some context
bic->bfqq will be freed, and bic_set_bfqq() is called with the freed
bic->bfqq.
Fix the problem by always freeing bfqq after bic_set_bfqq().
Fixes: 64dc8c7 ("block, bfq: fix possible uaf for 'bfqq->bic'")
Reported-and-tested-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230130014136.591038-1-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent db3ba97 commit b600de2
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
772 | | - | |
773 | 772 | | |
| 773 | + | |
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5425 | 5425 | | |
5426 | 5426 | | |
5427 | 5427 | | |
5428 | | - | |
| 5428 | + | |
| 5429 | + | |
5429 | 5430 | | |
5430 | 5431 | | |
| 5432 | + | |
5431 | 5433 | | |
5432 | 5434 | | |
5433 | 5435 | | |
| |||
0 commit comments