Skip to contentSkip to conversation

drm/amdgpu/mes: fix use-after-free issue

PATCH In review Jack Xiao 3 participants 3 messages Apr 22, 2024

Subsystems (2)
lore
Share & tools
lore

Jack Xiao

author
#0 lore raw

PATCH v2 1/1 drm/amdgpu/mes: fix use-after-free issue

Delete fence fallback timer to fix the ramdom
use-after-free issue.

v2: move to amdgpu_mes.c

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -0
index 78e4f88f5134..226751ea084b 100644
@@ -1128,6 +1128,7 @@ void amdgpu_mes_remove_ring(struct amdgpu_device *adev,
 		return;
 
 	amdgpu_mes_remove_hw_queue(adev, ring->hw_queue_id);
+	del_timer_sync(&ring->fence_drv.fallback_timer);
 	amdgpu_ring_fini(ring);
 	kfree(ring);
 }
Signature · 1 line
2.41.0
Acked-by on v2 1/1
#1 lore raw
Quoted 6 lines · Jack Xiao

Delete fence fallback timer to fix the ramdom
use-after-free issue.

v2: move to amdgpu_mes.c

Thanks,
Lijo

Quoted 16 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -0
index 78e4f88f5134..226751ea084b 100644
@@ -1128,6 +1128,7 @@ void amdgpu_mes_remove_ring(struct amdgpu_device *adev,
 		return;
 
 	amdgpu_mes_remove_hw_queue(adev, ring->hw_queue_id);
+	del_timer_sync(&ring->fence_drv.fallback_timer);
 	amdgpu_ring_fini(ring);
 	kfree(ring);
 }
maintainer Acked-by
#2 lore raw

Am 22.04.24 um 13:12 schrieb Lazar, Lijo:

Quoted 9 lines · Jack Xiao
Quoted 6 lines

Delete fence fallback timer to fix the ramdom
use-after-free issue.

v2: move to amdgpu_mes.c

Quoted 20 lines

Thanks,
Lijo

Quoted 16 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -0
index 78e4f88f5134..226751ea084b 100644
@@ -1128,6 +1128,7 @@ void amdgpu_mes_remove_ring(struct amdgpu_device *adev,
  		return;
 
  	amdgpu_mes_remove_hw_queue(adev, ring->hw_queue_id);
+	del_timer_sync(&ring->fence_drv.fallback_timer);
  	amdgpu_ring_fini(ring);
  	kfree(ring);
  }