diff options
| author | Ming Lei <[email protected]> | 2024-12-25 11:06:40 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2024-12-26 13:42:55 +0000 |
| commit | 75cd4005da5492129917a4a4ee45e81660556104 (patch) | |
| tree | a74812e05a2ad1a767e955e691696980ca3940c5 /drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | |
| parent | block: avoid to reuse `hctx` not removed from cpuhp callback list (diff) | |
| download | kernel-75cd4005da5492129917a4a4ee45e81660556104.tar.gz kernel-75cd4005da5492129917a4a4ee45e81660556104.zip | |
ublk: detach gendisk from ublk device if add_disk() fails
Inside ublk_abort_requests(), gendisk is grabbed for aborting all
inflight requests. And ublk_abort_requests() is called when exiting
the uring context or handling timeout.
If add_disk() fails, the gendisk may have been freed when calling
ublk_abort_requests(), so use-after-free can be caused when getting
disk's reference in ublk_abort_requests().
Fixes the bug by detaching gendisk from ublk device if add_disk() fails.
Fixes: bd23f6c2c2d0 ("ublk: quiesce request queue when aborting queue")
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 'drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c')
0 files changed, 0 insertions, 0 deletions
