]> xenbits.xensource.com Git - qemu-upstream-4.3-testing.git/commit
virtio: out-of-bounds buffer write on invalid state load
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 4 Mar 2015 16:14:08 +0000 (16:14 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 4 Mar 2015 16:14:08 +0000 (16:14 +0000)
commit2ee75346e69ec5ab5f36c90e2e2aa8e8bfd3c7dc
tree79ae9d1c0400834d6b501553fecf6b92b1acea73
parent767d23f833251c52fe7853d835aa47e1daaae2ab
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>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/virtio.c