Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Use local fence in error path of xe_migrate_clear
@ 2025-03-11 18:29 Matthew Brost
  2025-03-11 21:14 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Matthew Brost @ 2025-03-11 18:29 UTC (permalink / raw)
  To: intel-xe

The intent of the error path in xe_migrate_clear is to wait on locally
generated fence and then return. The code is waiting on m->fence which
could be the local fence but this is only stable under the job mutex
leading to a possible UAF. Fix code to wait on local fence.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index df4282c71bf0..a83bebef3780 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -1177,7 +1177,7 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
 err_sync:
 		/* Sync partial copies if any. FIXME: job_mutex? */
 		if (fence) {
-			dma_fence_wait(m->fence, false);
+			dma_fence_wait(fence, false);
 			dma_fence_put(fence);
 		}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-12 13:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 18:29 [PATCH] drm/xe: Use local fence in error path of xe_migrate_clear Matthew Brost
2025-03-11 21:14 ` ✓ CI.Patch_applied: success for " Patchwork
2025-03-11 21:15 ` ✓ CI.checkpatch: " Patchwork
2025-03-11 21:16 ` ✓ CI.KUnit: " Patchwork
2025-03-11 21:32 ` ✓ CI.Build: " Patchwork
2025-03-11 21:35 ` ✓ CI.Hooks: " Patchwork
2025-03-11 21:36 ` ✓ CI.checksparse: " Patchwork
2025-03-11 21:55 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-12  9:49 ` [PATCH] " Matthew Auld
2025-03-12 13:18 ` ✗ Xe.CI.Full: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox