]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitea4c44dccb352e57c81132021ad99b4f3604933f
tree67f575a67d56393d416aeb208129a956e1266428
parentce9b3dab3410cea3c9660b8753c955fff3771cd2
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: a87fd772edc0 ("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