drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()
authorMurray McAllister <murray.mcallister@gmail.com>
Sat, 11 May 2019 06:01:37 +0000 (18:01 +1200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:17:20 +0000 (08:17 +0200)
commit36796bd8999aac9c83a8c9f7d3411a34a0768dd6
tree6de6c5e282776e8fb6cdabc904a13645974f2d2d
parenta47f9e9eccaec7110291ea993eccf9c8704275fb
drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()

commit bcd6aa7b6cbfd6f985f606c6f76046d782905820 upstream.

If SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW is called with a surface
ID of SVGA3D_INVALID_ID, the srf struct will remain NULL after
vmw_cmd_res_check(), leading to a null pointer dereference in
vmw_view_add().

Cc: <stable@vger.kernel.org>
Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support")
Signed-off-by: Murray McAllister <murray.mcallister@gmail.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c