Commit d03a3630 authored by Cornelia Huck's avatar Cornelia Huck
Browse files

virtio-ccw: range check in READ_VQ_CONF



Processing for READ_VQ_CONF needs to check whether the requested queue
value is actually in the supported range and post a channel program
check if not.

Cc: qemu-stable@nongnu.org
Reviewed-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
parent 590fe572
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -549,6 +549,10 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
            ret = -EFAULT;
        } else {
            vq_config.index = lduw_be_phys(&address_space_memory, ccw.cda);
            if (vq_config.index >= VIRTIO_PCI_QUEUE_MAX) {
                ret = -EINVAL;
                break;
            }
            vq_config.num_max = virtio_queue_get_num(vdev,
                                                     vq_config.index);
            stw_be_phys(&address_space_memory,