OSDN Git Service

drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()
authorMurray McAllister <murray.mcallister@insomniasec.com>
Mon, 27 Mar 2017 09:12:53 +0000 (11:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:38:32 +0000 (12:38 +0200)
commitb26629453c7b2a6c82000b36fbd1cfc4d9101808
treec95ee39bc2f876ca9773d027db9137cbb4024d28
parented528923541afc1228c5a66e98845148aca51e24
drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()

commit 36274ab8c596f1240c606bb514da329add2a1bcd upstream.

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.

Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c