drm: Assert held reservation lock for dma-buf mmapping
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Thu, 10 Nov 2022 20:13:45 +0000 (23:13 +0300)
committerDmitry Osipenko <dmitry.osipenko@collabora.com>
Fri, 11 Nov 2022 20:49:47 +0000 (23:49 +0300)
commit39ce252918712180f5a64853920a320981dac94b
tree276027d84b0c6b8e65c8c3917068279b08561707
parent8526e973647e1bf77dadf894a36aefd4fd1b8a3f
drm: Assert held reservation lock for dma-buf mmapping

When userspace mmaps dma-buf's fd, the dma-buf reservation lock must be
held. Add locking sanity checks to the dma-buf mmaping callbacks of DRM
drivers to ensure that the locking assumptions won't regress in future.

Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221110201349.351294-3-dmitry.osipenko@collabora.com
drivers/gpu/drm/drm_prime.c
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
drivers/gpu/drm/tegra/gem.c