drm/vmwgfx: Make sure backup_handle is always valid
authorSinclair Yeh <syeh@vmware.com>
Fri, 2 Jun 2017 05:50:57 +0000 (07:50 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 6 Aug 2017 04:24:47 +0000 (05:24 +0100)
commit765353fe0a2adcd7e04dd995d5edf66b060af5bf
treec5fde350685d544f48306bae255d12968ce70ce1
parent069b6d029e86abc0688652e922a204632820de90
drm/vmwgfx: Make sure backup_handle is always valid

When vmw_gb_surface_define_ioctl() is called with an existing buffer,
we end up returning an uninitialized variable in the backup_handle.

The fix is to first initialize backup_handle to 0 just to be sure, and
second, when a user-provided buffer is found, we will use the
req->buffer_handle as the backup_handle.

Cc: <stable@vger.kernel.org>
Reported-by: Murray McAllister <murray.mcallister@insomniasec.com>
Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name drm-vmwgfx-Make-sure-backup_handle-is-always-valid.patch
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c