drm/i915/gem: Safely acquire the ctx->vm when copying
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 6 Nov 2019 09:13:12 +0000 (09:13 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 7 Nov 2019 17:05:33 +0000 (17:05 +0000)
commit27dbae8f36c1c25008b7885fc07c57054b7dfba3
treebb14f321d5d9ffc77383298d97946321604e3d17
parent7caaed94eade788e79618685a52e223f23786e0d
drm/i915/gem: Safely acquire the ctx->vm when copying

As we read the ctx->vm unlocked before cloning/exporting, we should
validate our reference is correct before returning it. We already do for
clone_vm() but were not so strict around get_ppgtt().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191106091312.12921-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_context.c