]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commit
virtio: out-of-bounds buffer write on invalid state load
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 3 Apr 2014 16:51:14 +0000 (19:51 +0300)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 4 Mar 2015 16:13:14 +0000 (16:13 +0000)
commitdee7babbcc9277a63c1aa0cfd6424e6464a30b3a
tree89f9c11a7c951d51b477d392ef061a2a7da7c4d3
parent651a486593475f02ab0aa531426ef5da135d3b7a
virtio: out-of-bounds buffer write on invalid state load

CVE-2013-4151 QEMU 1.0 out-of-bounds buffer write in
virtio_load@hw/virtio/virtio.c

So we have this code since way back when:

    num = qemu_get_be32(f);

    for (i = 0; i < num; i++) {
        vdev->vq[i].vring.num = qemu_get_be32(f);

array of vqs has size VIRTIO_PCI_QUEUE_MAX, so
on invalid input this will write beyond end of buffer.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
hw/virtio/virtio.c