Commit bcd6aa7b6cbf ("drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()") upstream. That commit resolved a NULL pointer dereference in vmw_view_add(), which occurred if SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW was called with a surface ID of SVGA3D_INVALID_ID. (The original patch failed to apply cleanly in 4.9-stable as VMW_DEBUG_USER does not exist here.) Signed-off-by: Murray McAllister <murray.mcallister@xxxxxxxxx> --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index c7b53d987f06..1e44ac1d6fb3 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -2730,6 +2730,10 @@ static int vmw_cmd_dx_view_define(struct vmw_private *dev_priv, view_type = vmw_view_cmd_to_type(header->id); cmd = container_of(header, typeof(*cmd), header); + if (unlikely(cmd->sid == SVGA3D_INVALID_ID)) { + DRM_ERROR("Invalid surface id.\n"); + return -EINVAL; + } ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, user_surface_converter, &cmd->sid, &srf_node); -- 2.20.1