Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64cfae19 authored by Dan Carpenter's avatar Dan Carpenter Committed by Alistair Delva
Browse files

UPSTREAM: 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: 62fb7a5e ("virtio-gpu: add 3d/virgl support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180704094250.m7sgvvzg3dhcvv3h@kili.mountain


Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 09c4b49457434fa74749ad6194ef28464d9f5df9)
Signed-off-by: default avatarGreg Hartman <ghartman@google.com>
BUG: 139386237
Change-Id: I73320cd2012a6e712cb910c5ebedb665d99e1205
parent a6147c0e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment