[Intel-gfx] [PATCH] drm/i915: mark requests for GuC virtual engines to avoid use-after-free

Andi Shyti andi.shyti at linux.intel.com
Wed Aug 30 13:50:07 UTC 2023


Hi Andrzej,

On Mon, Aug 21, 2023 at 05:30:35PM +0200, Andrzej Hajda wrote:
> 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: bcb9aa45d5a0 ("Revert "drm/i915: Hold reference to intel_context over life of i915_request"")
> Signed-off-by: Chris Wilson <chris.p.wilson at linux.intel.com>
> Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>
> Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>

applied to drm-intel-gt-next.

Thanks,
Andi


More information about the Intel-gfx mailing list