]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/vmwgfx: fix potential UAF in vmwgfx_surface.c
authorDesmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Sat, 24 Jul 2021 11:18:24 +0000 (19:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:42:10 +0000 (13:42 +0200)
commit36072646648224af69899f02d423842aec495641
tree34e4160d3fe600917bb7332ff6a8cc4383f6cf2d
parentff6e9e7f7d371ef9c0f91afd22aa4bc0048be9af
drm/vmwgfx: fix potential UAF in vmwgfx_surface.c

[ Upstream commit 2bc5da528dd570c5ecabc107e6fbdbc55974276f ]

drm_file.master should be protected by either drm_device.master_mutex
or drm_file.master_lookup_lock when being dereferenced. However,
drm_master_get is called on unprotected file_priv->master pointers in
vmw_surface_define_ioctl and vmw_gb_surface_define_internal.

This is fixed by replacing drm_master_get with drm_file_get_master.

Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210724111824.59266-4-desmondcheongzx@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c