drm/msm: Ensure mmap offset is initialized
authorRob Clark <robdclark@chromium.org>
Tue, 31 May 2022 20:08:56 +0000 (13:08 -0700)
committerRob Clark <robdclark@chromium.org>
Thu, 2 Jun 2022 00:20:08 +0000 (17:20 -0700)
commit036d20726c30267724416e966c9f92db07de8081
tree67f575a67d56393d416aeb208129a956e1266428
parentaf0f2a8cc3977e08e79a096f0c2c7a5be29b130b
drm/msm: Ensure mmap offset is initialized

If a GEM object is allocated, and then exported as a dma-buf fd which is
mmap'd before or without the GEM buffer being directly mmap'd, the
vma_node could be unitialized.  This leads to a situation where the CPU
mapping is not correctly torn down in drm_vma_node_unmap().

Fixes: e5516553999f ("drm: call drm_gem_object_funcs.mmap with fake offset")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220531200857.136547-1-robdclark@gmail.com
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_drv.h
drivers/gpu/drm/msm/msm_gem_prime.c