diff options
author | Ming Lei <[email protected]> | 2022-03-18 21:01:42 +0800 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2022-03-18 09:57:56 -0600 |
commit | ee37eddbfa9e0401f13a01691cf4bbbacd2d16c9 (patch) | |
tree | 8419fbd2e8d0b4206a577da2c46465318a37b13a /include/linux/zstd_errors.h | |
parent | 572299f03afd676dd4e20669cdaf5ed0fe1379d4 (diff) |
block: avoid use-after-free on throttle data
In throtl_pending_timer_fn(), request queue is retrieved from throttle
data. And tg's pending timer is deleted synchronously when releasing the
associated blkg, at that time, throttle data may have been freed since
commit 1059699f87eb ("block: move blkcg initialization/destroy into disk
allocation/release handler") moves freeing q->td to disk_release() from
blk_release_queue(). So use-after-free on q->td in throtl_pending_timer_fn
can be triggered.
Fixes the issue by:
- do nothing in case that disk is released, when there isn't any bio to
dispatch
- retrieve request queue from blkg instead of throttle data for
non top-level pending timer.
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'include/linux/zstd_errors.h')
0 files changed, 0 insertions, 0 deletions