]> Git Repo - qemu.git/commitdiff
virtio-ccw: fix range check for SET_VQ
authorCornelia Huck <[email protected]>
Fri, 20 Mar 2015 12:08:36 +0000 (13:08 +0100)
committerCornelia Huck <[email protected]>
Mon, 30 Mar 2015 07:25:17 +0000 (09:25 +0200)
VIRTIO_PCI_QUEUE_MAX is already too big; a malicious guest would be
able to trigger a write beyond the VirtQueue structure.

Cc: [email protected]
Reviewed-by: David Hildenbrand <[email protected]>
Acked-by: Christian Borntraeger <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
hw/s390x/virtio-ccw.c

index 130535cdc311bf9d6633268dc138fa01e374c1a2..ceb6a457035024e629728bd55f7edd637e00c9dc 100644 (file)
@@ -266,7 +266,7 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align,
 {
     VirtIODevice *vdev = virtio_ccw_get_vdev(sch);
 
-    if (index > VIRTIO_PCI_QUEUE_MAX) {
+    if (index >= VIRTIO_PCI_QUEUE_MAX) {
         return -EINVAL;
     }
 
This page took 0.026025 seconds and 4 git commands to generate.