]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: rework userq fence driver alloc/destroy
authorPrike Liang <Prike.Liang@amd.com>
Tue, 17 Mar 2026 10:54:55 +0000 (11:54 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 3 Apr 2026 17:59:28 +0000 (13:59 -0400)
commit34f31fe40f3a19cd3427130ac7558ca2504853ae
tree94734949924cf3b4a2031135655d62a814dfcff5
parent05ce444171cf2ec89ce0f8c37700375b817454b0
drm/amdgpu: rework userq fence driver alloc/destroy

The correct fix is to tie the global xa entry lifetime to the
queue lifetime: insert in amdgpu_userq_create() and erase in
amdgpu_userq_cleanup(), both at the well-defined doorbell_index key,
making the operation O(1) and resolve the fence driver UAF problem
by binding the userq driver fence to per queue.

v2: clean up the local variables initialization. (Christian)

Signed-off-by: Prike Liang <Prike.Liang@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.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c