]> xenbits.xensource.com Git - qemu-upstream-4.2-testing.git/commit
virtio: avoid buffer overrun on incoming migration
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 4 Mar 2015 16:57:56 +0000 (16:57 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 13:22:11 +0000 (13:22 +0000)
commit501d7f8faa05597ebb0bb54dea7d323967fa449b
treefa1a15220f11c309ef078064fa12ac1eb3c4b3bd
parentf25df9882827c8e488fe3f36cc7796b99302391b
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