]> xenbits.xensource.com Git - qemu-upstream-4.4-testing.git/commit
virtio: avoid buffer overrun on incoming migration
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Apr 2014 16:51:46 +0000 (19:51 +0300)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 13:21:38 +0000 (13:21 +0000)
commitd961961ec93227065fd343f5725a1ff756d6981f
tree564f8a42c74ecbb1910769612db7f530d007370e
parentba607aad864dd66067bc9a7fd861e29a06811236
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/virtio.c