Loading
drm/virtio: Fix GEM handle creation UAF
stable inclusion from stable-v4.19.270 commit 19ec87d06acfab2313ee82b2a689bf0c154e57ea category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IALIA1 CVE: CVE-2022-48899 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=19ec87d06acfab2313ee82b2a689bf0c154e57ea -------------------------------- [ Upstream commit 52531258 ] Userspace can guess the handle value and try to race GEM object creation with handle close, resulting in a use-after-free if we dereference the object after dropping the handle's reference. For that reason, dropping the handle's reference must be done *after* we are done dereferencing the object. Signed-off-by:Rob Clark <robdclark@chromium.org> Reviewed-by:
Chia-I Wu <olvaffe@gmail.com> Fixes: 62fb7a5e ("virtio-gpu: add 3d/virgl support") Cc: stable@vger.kernel.org Signed-off-by:
Dmitry Osipenko <dmitry.osipenko@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221216233355.542197-2-robdclark@gmail.com Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Zeng Heng <zengheng4@huawei.com>