]> git.ipfire.org Git - thirdparty/linux.git/commit
Revert "drm/amdgpu: fix slab-use-after-free in amdgpu_userq_mgr_fini"
authorVitaly Prosyak <vitaly.prosyak@amd.com>
Tue, 24 Jun 2025 16:05:10 +0000 (12:05 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Jul 2025 17:48:50 +0000 (13:48 -0400)
commita73345b866ff8bbd93135af667c973a8fb4b2c40
treeb2f4a07578b636e84de28f13cd5b9ce5279e6c0f
parentdf2719088b6a8084960ed6e2ddc7066ffc5b558d
Revert "drm/amdgpu: fix slab-use-after-free in amdgpu_userq_mgr_fini"

This reverts commit 5fb90421fa0fbe0a968274912101fe917bf1c47b.

The original patch moved `amdgpu_userq_mgr_fini()` to the driver's
`postclose` callback, which is called after `drm_gem_release()` in
the DRM file cleanup sequence.If a user application crashes or aborts
without cleaning up its user queues, 'drm_gem_release()` may free
GEM objects that are still referenced by active user queues, leading
to use-after-free. By reverting, we ensure that user queues are
disabled and cleaned up before any GEM objects are released,
preventing this class of bug. However, this reintroduces a race
during PCI hot-unplug, where device removal can race with per-file
cleanup, leading to use-after-free in suspend/unplug paths.
This will be fixed in the next patch.

Fixes: 5fb90421fa0f ("drm/amdgpu: fix slab-use-after-free in amdgpu_userq_mgr_fini+0x70c")
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c