]> git.ipfire.org Git - thirdparty/qemu.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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 6 Aug 2014 19:55:48 +0000 (14:55 -0500)
commit48935f029f5ae7f6bd6f01b2c942a7f2f1a7bc9a
treeec8d46a7f8ec5595dd129c8ea14387286bd4ef4a
parent347744507794a96b0125a8b395ae30ff952004a2
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>
(cherry picked from commit cc45995294b92d95319b4782750a3580cabdbc0c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/virtio/virtio.c