summaryrefslogtreecommitdiff
path: root/block/blk-ia-ranges.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-09-09 21:41:48 +0800
committerJens Axboe <axboe@kernel.dk>2024-09-10 16:32:09 -0600
commit1ba0403ac6447f2d63914fb760c44a3b19c44eaf (patch)
treed9d4c82ad7fb1b227949d2c76fcb893d94c0122b /block/blk-ia-ranges.c
parent29390bb5661d49d10424ad8e915230de1f7074c9 (diff)
block, bfq: fix uaf for accessing waker_bfqq after splitting
After commit 42c306ed7233 ("block, bfq: don't break merge chain in bfq_split_bfqq()"), if the current procress is the last holder of bfqq, the bfqq can be freed after bfq_split_bfqq(). Hence recored the bfqq and then access bfqq->waker_bfqq may trigger UAF. What's more, the waker_bfqq may in the merge chain of bfqq, hence just recored waker_bfqq is still not safe. Fix the problem by adding a helper bfq_waker_bfqq() to check if bfqq->waker_bfqq is in the merge chain, and current procress is the only holder. Fixes: 42c306ed7233 ("block, bfq: don't break merge chain in bfq_split_bfqq()") Signed-off-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20240909134154.954924-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-ia-ranges.c')
0 files changed, 0 insertions, 0 deletions