Skip to content
Commit bed4b455 authored by Rob Clark's avatar Rob Clark Committed by Tvrtko Ursulin
Browse files

drm/i915: Fix potential context UAFs



gem_context_register() makes the context visible to userspace, and which
point a separate thread can trigger the I915_GEM_CONTEXT_DESTROY ioctl.
So we need to ensure that nothing uses the ctx ptr after this.  And we
need to ensure that adding the ctx to the xarray is the *last* thing
that gem_context_register() does with the ctx pointer.

Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Fixes: eb4dedae ("drm/i915/gem: Delay tracking the GEM context until it is registered")
Fixes: a4c1cdd3 ("drm/i915/gem: Delay context creation (v3)")
Fixes: 49bd54b3

 ("drm/i915: Track all user contexts per client")
Cc: <stable@vger.kernel.org> # v5.10+
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
[tursulin: Stable and fixes tags add/tidy.]
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230103234948.1218393-1-robdclark@gmail.com
parent 4f0755c2
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