Skip to content

Commit 2e82474

Browse files
matt-auldThomas Hellström
authored andcommitted
drm/xe/guc_submit: add back fix
Daniele noticed that the fix in commit 2d2be27 ("drm/xe: fix UAF around queue destruction") looks to have been unintentionally removed as part of handling a conflict in some past merge commit. Add it back. Fixes: ac44ff7 ("Merge tag 'drm-xe-fixes-2024-10-10' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes") Reported-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Cc: Matthew Brost <[email protected]> Cc: <[email protected]> # v6.12+ Reviewed-by: Matthew Brost <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit 9d9fca6) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 69a58ef commit 2e82474

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q)
229229
static void guc_submit_fini(struct drm_device *drm, void *arg)
230230
{
231231
struct xe_guc *guc = arg;
232+
struct xe_device *xe = guc_to_xe(guc);
233+
struct xe_gt *gt = guc_to_gt(guc);
234+
int ret;
235+
236+
ret = wait_event_timeout(guc->submission_state.fini_wq,
237+
xa_empty(&guc->submission_state.exec_queue_lookup),
238+
HZ * 5);
239+
240+
drain_workqueue(xe->destroy_wq);
241+
242+
xe_gt_assert(gt, ret);
232243

233244
xa_destroy(&guc->submission_state.exec_queue_lookup);
234245
}

0 commit comments

Comments
 (0)