]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
drm/shmem-helper: Avoid vm_open error paths
authorRob Clark <robdclark@chromium.org>
Wed, 30 Nov 2022 18:57:48 +0000 (10:57 -0800)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:02:54 +0000 (14:02 +0100)
commit72d8d2bd915c947f76b54d640963a805dcb5cf97
treef6ce9531f5700b0fb08929785ddd215eb60c7792
parentd15f39047fa13e693c8b4471af0d1f573ce7e93d
drm/shmem-helper: Avoid vm_open error paths

commit 09bf649a74573cb596e211418a4f8008f265c5a9 upstream.

vm_open() is not allowed to fail.  Fortunately we are guaranteed that
the pages are already pinned, thanks to the initial mmap which is now
being cloned into a forked process, and only need to increment the
refcnt.  So just increment it directly.  Previously if a signal was
delivered at the wrong time to the forking process, the
mutex_lock_interruptible() could fail resulting in the pages_use_count
not being incremented.

Fixes: 2194a63a818d ("drm: Add library for shmem backed GEM objects")
Cc: stable@vger.kernel.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221130185748.357410-3-robdclark@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1074fefce9cc6730fe5f602c0287850c2698e315)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/gpu/drm/drm_gem_shmem_helper.c