]> xenbits.xensource.com Git - qemu-upstream-4.3-testing.git/commit
virtio: avoid buffer overrun on incoming migration
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 4 Mar 2015 16:57:44 +0000 (16:57 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 13:21:56 +0000 (13:21 +0000)
commitac8befd9cfaa151ad8a0473342a0faae8bffc250
tree38719729a47a6daf619e620a983a5cd4828fd664
parent300645d88fe9f42873cf1195e883680111065a58
virtio: avoid buffer overrun on incoming migration

CVE-2013-6399

vdev->queue_sel is read from the wire, and later used in the
emulation code as an index into vdev->vq[]. If the value of
vdev->queue_sel exceeds the length of vdev->vq[], currently
allocated to be VIRTIO_PCI_QUEUE_MAX elements, subsequent PIO
operations such as VIRTIO_PCI_QUEUE_PFN can be used to overrun
the buffer with arbitrary data originating from the source.

Fix this by failing migration if the value from the wire exceeds
VIRTIO_PCI_QUEUE_MAX.

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