Rob Clark 19ec87d06a drm/virtio: Fix GEM handle creation UAF
[ Upstream commit 52531258318ed59a2dc5a43df2eaf0eb1d65438e ]

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: 62fb7a5e1096 ("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>
2023-01-18 11:30:56 +01:00
..
2019-12-13 08:52:44 +01:00
2020-06-30 23:17:17 -04:00
2021-11-26 11:36:24 +01:00
2018-07-13 18:40:28 +02:00
2020-02-11 04:34:07 -08:00
2018-12-13 09:16:21 +01:00
2021-03-30 14:36:58 +02:00