drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()
Before memory allocations vmw_surface_define_ioctl() checks the
upper-bounds of a user-supplied size, but does not check if the
supplied size is 0.
Add check to avoid NULL pointer dereferences.
Cc: <stable@vger.kernel.org>
Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Orabug:
27913367
CVE: CVE-2017-7294
(cherry picked from commit
36274ab8c596f1240c606bb514da329add2a1bcd)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Shan Hai <shan.hai@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>