linux/drivers/gpu/drm/virtio
Dan Carpenter 09c4b49457 drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset()
This doesn't affect runtime because in the current code "idx" is always
valid.

First, we read from "vgdev->capsets[idx].max_size" before checking
whether "idx" is within bounds.  And secondly the bounds check is off by
one so we could end up reading one element beyond the end of the
vgdev->capsets[] array.

Fixes: 62fb7a5e10 ("virtio-gpu: add 3d/virgl support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180704094250.m7sgvvzg3dhcvv3h@kili.mountain
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-08-30 09:41:03 +02:00
..
Kconfig drm: fix compilations issues introduced by "drm: allow to use mmuless SoC" 2017-01-09 11:30:30 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
virtgpu_debugfs.c drm/virtio: fix include notation and remove -Iinclude/drm flag 2017-05-18 07:12:31 +02:00
virtgpu_display.c drm: drop _mode_ from drm_mode_connector_attach_encoder 2018-07-13 18:40:27 +02:00
virtgpu_drm_bus.c drm/virtio: Replace drm_dev_unref with drm_dev_put 2018-08-10 07:57:49 +02:00
virtgpu_drv.c drm/virtio: Remove multiple blank lines 2018-02-27 08:40:42 +01:00
virtgpu_drv.h drm/virtio: Replace ttm_bo_unref with ttm_bo_put 2018-08-30 09:41:02 +02:00
virtgpu_fb.c drm/virtio: Place GEM BOs in drm_framebuffer 2018-05-18 14:52:33 +01:00
virtgpu_fence.c drm/virtio: Remove unecessary dma_fence_ops 2018-07-03 13:14:18 +02:00
virtgpu_gem.c drm/virtio: Add blank line after variable declarations 2018-02-27 08:40:37 +01:00
virtgpu_ioctl.c Linux 4.16-rc7 2018-03-28 14:30:41 +10:00
virtgpu_kms.c virtgpu: remove redundant task_comm copying 2017-11-10 12:45:35 +01:00
virtgpu_object.c drm/ttm: drop persistent_swap_storage from ttm_bo_init and co 2018-02-26 23:09:45 -05:00
virtgpu_plane.c drm/virtio: Place GEM BOs in drm_framebuffer 2018-05-18 14:52:33 +01:00
virtgpu_prime.c drm/virtio: Remove multiple blank lines 2018-02-27 08:40:42 +01:00
virtgpu_ttm.c gpu: drm: virtio: code cleanup 2018-08-08 09:11:53 +02:00
virtgpu_vq.c drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset() 2018-08-30 09:41:03 +02:00