]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Use local fence in error path of xe_migrate_clear
authorMatthew Brost <matthew.brost@intel.com>
Tue, 11 Mar 2025 18:29:15 +0000 (11:29 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 27 Mar 2025 22:30:57 +0000 (15:30 -0700)
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")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20250311182915.3606291-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_migrate.c

index f64530a64b016ab9b2dab6e256a0f4848c492e48..ff0fc2fb0eb9f684cce652a94cb33c44e233dc9a 100644 (file)
@@ -1177,7 +1177,7 @@ err:
 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);
                }