]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix race in __i915_vma_remove_closed
authorKarol Herbst <kherbst@redhat.com>
Wed, 20 Apr 2022 09:57:20 +0000 (11:57 +0200)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 4 May 2022 15:22:13 +0000 (16:22 +0100)
commitfa7a70a04620bd146c34ca64fa78c0d7772cf4d7
treea598f6964493dd7517e7edf5cd051aca40ca157a
parent4a4bad9db102eb72e42675842d01c8a2861afcf3
drm/i915: Fix race in __i915_vma_remove_closed

i915_vma_reopen checked if the vma is closed before without taking the
lock. So multiple threads could attempt removing the vma.

Instead the lock needs to be taken before actually checking.

v2: move struct declaration

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v5.3+
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5732
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Fixes: 9e682f2c24e4 ("drm/i915: Move object close under its own lock")
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220420095720.3331609-1-kherbst@redhat.com
drivers/gpu/drm/i915/i915_vma.c