]> 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)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 24 Sep 2020 12:59:41 +0000 (13:59 +0100)
commit512d59499ebf0abfa3d625703ce9ece3d2504887
treefc1923467a7b7577f318d2f035ad98b7c9d01f72
parentd69e78820c61375f6b2497c8225e930ff9b2e4d8
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
drivers/gpu/drm/i915/i915_debugfs.c