Skip to content
Commit 5eefc530 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Rodrigo Vivi
Browse files

drm/i915: mark requests for GuC virtual engines to avoid use-after-free



References to i915_requests may be trapped by userspace inside a
sync_file or dmabuf (dma-resv) and held indefinitely across different
proceses. To counter-act the memory leaks, we try to not to keep
references from the request past their completion.
On the other side on fence release we need to know if rq->engine
is valid and points to hw engine (true for non-virtual requests).
To make it possible extra bit has been added to rq->execution_mask,
for marking virtual engines.

Fixes: bcb9aa45 ("Revert "drm/i915: Hold reference to intel_context over life of i915_request"")
Signed-off-by: default avatarChris Wilson <chris.p.wilson@linux.intel.com>
Signed-off-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230821153035.3903006-1-andrzej.hajda@intel.com


(cherry picked from commit 28041067)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 3698a75f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment