drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl()
authorVladis Dronov <vdronov@redhat.com>
Fri, 2 Jun 2017 05:42:09 +0000 (07:42 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 6 Aug 2017 04:24:47 +0000 (05:24 +0100)
commit9b5cc37a71249632fd112aa2591dd63fbffe2fa7
treeb104206bf6fc9bf4e005708aa05179aa55b1a567
parente2bdc6c31185c695003074a188b0acc1647b4459
drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl()

The 'req->mip_levels' parameter in vmw_gb_surface_define_ioctl() is
a user-controlled 'uint32_t' value which is used as a loop count limit.
This can lead to a kernel lockup and DoS. Add check for 'req->mip_levels'.

References:
https://bugzilla.redhat.com/show_bug.cgi?id=1437431

Cc: <stable@vger.kernel.org>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name drm-vmwgfx-limit-the-number-of-mip-levels-in-vmw_gb_.patch
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c