]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Serialise debugfs i915_gem_objects with ctx->mutex
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Jul 2020 17:21:19 +0000 (18:21 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 30 Sep 2020 18:24:37 +0000 (14:24 -0400)
commitb312e84a736c2a787f2f91536d79f94b9755934d
tree138f5cc7f7c3beddd27bd283a778205a49001f50
parent152b00d38fbe14e8f8c0cc617e4416bc67f5ccda
drm/i915/gem: Serialise debugfs i915_gem_objects with ctx->mutex

Since the debugfs may peek into the GEM contexts as the corresponding
client/fd is being closed, we may try and follow a dangling pointer.
However, the context closure itself is serialised with the ctx->mutex,
so if we hold that mutex as we inspect the state coupled in the context,
we know the pointers within the context are stable and will remain valid
as we inspect their tables.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: CQ Tang <cq.tang@intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200723172119.17649-3-chris@chris-wilson.co.uk
(cherry picked from commit 102f5aa491f262c818e607fc4fee08a724a76c69)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/i915_debugfs.c