]> git.baikalelectronics.ru Git - kernel.git/commit
drm/shmem-helper: Remove another errant put in error path
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Sun, 8 Jan 2023 21:13:11 +0000 (00:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:34:00 +0000 (13:34 +0100)
commit5f4ef6ab6f59e06d164b8bebd3f8e5dedb0fcba8
tree1d96e2a378fed724ef30b664fca13cf42215df83
parent0109e53fe920f7b5d5b221b337c611bfc31fbd38
drm/shmem-helper: Remove another errant put in error path

commit 3244422541603df9ddc56c40a70330df86aa5d4f upstream.

drm_gem_shmem_mmap() doesn't own reference in error code path, resulting
in the dma-buf shmem GEM object getting prematurely freed leading to a
later use-after-free.

Fixes: 4ed95f7c9dbd ("drm/shme-helpers: Fix dma_buf_mmap forwarding bug")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230108211311.3950107-1-dmitry.osipenko@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_gem_shmem_helper.c