linux-stable/drivers/gpu/drm/virtio
Dan Carpenter 043bf2daf5 drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset()
[ Upstream commit 09c4b49457 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:49:54 +01:00
..
Kconfig
Makefile
virtgpu_debugfs.c
virtgpu_display.c drm: drop _mode_ from drm_mode_connector_attach_encoder 2018-07-13 18:40:27 +02:00
virtgpu_drm_bus.c
virtgpu_drv.c
virtgpu_drv.h drm/virtio: Place GEM BOs in drm_framebuffer 2018-05-18 14:52:33 +01: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
virtgpu_ioctl.c drm/virtio: Add memory barriers for capset cache. 2019-07-31 07:27:00 +02:00
virtgpu_kms.c
virtgpu_object.c
virtgpu_plane.c drm/virtio: Place GEM BOs in drm_framebuffer 2018-05-18 14:52:33 +01:00
virtgpu_prime.c
virtgpu_ttm.c drm/ttm: add bo as parameter to the ttm_tt_create callback 2018-03-14 14:38:27 -05:00
virtgpu_vq.c drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset() 2020-01-27 14:49:54 +01:00