]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Release driver tracking before making the object available again
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 19 Aug 2017 12:05:58 +0000 (13:05 +0100)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Tue, 22 Aug 2017 13:03:43 +0000 (16:03 +0300)
commit1a1ec51e231406815527e220b711fb477e391b21
treeaa34827d35580d03bebbb1dad9bf0483e5e80242
parent66238618dedd07dc6376cd4c0aca2a60e630620a
drm: Release driver tracking before making the object available again

This is the same bug as we fixed in commit dede60b2c188 ("drm: Release
driver references to handle before making it available again"), but now
the exposure is via the PRIME lookup tables. If we remove the
object/handle from the PRIME lut, then a new request for the same
object/fd will generate a new handle, thus for a short window that
object is known to userspace by two different handles. Fix this by
releasing the driver tracking before PRIME.

Fixes: cf5f720b6a18 ("drm/prime: add exported buffers to current fprivs
imported buffer list (v2)")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Thierry Reding <treding@nvidia.com>
Cc: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170819120558.6465-1-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_gem.c