Li Qiang e7e11f9956 drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl()
In vmw_surface_define_ioctl(), the 'num_sizes' is the sum of the
'req->mip_levels' array. This array can be assigned any value from
the user space. As both the 'num_sizes' and the array is uint32_t,
it is easy to make 'num_sizes' overflow. The later 'mip_levels' is
used as the loop count. This can lead an oob write. Add the check of
'req->mip_levels' to avoid this.

Cc: <stable@vger.kernel.org>
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2017-03-30 11:46:26 +02:00
..
2017-03-17 14:44:34 -04:00
2017-02-27 18:43:47 -08:00
2017-03-09 15:50:56 -08:00
2017-02-23 12:10:12 +10:00
2017-02-23 12:10:12 +10:00
2017-02-23 12:10:12 +10:00
2017-01-26 10:45:31 +01:00
2017-01-26 10:45:14 +01:00
2016-12-30 11:43:40 +01:00