[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 014/108] virtio: avoid buffer overrun on incoming m
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 014/108] virtio: avoid buffer overrun on incoming migration |
Date: |
Wed, 6 Aug 2014 15:38:24 -0500 |
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 <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
(cherry picked from commit 4b53c2c72cb5541cf394033b528a6fe2a86c0ac1)
Signed-off-by: Michael Roth <address@hidden>
---
hw/virtio/virtio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index aeabf3a..d497284 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -906,6 +906,9 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f)
qemu_get_8s(f, &vdev->status);
qemu_get_8s(f, &vdev->isr);
qemu_get_be16s(f, &vdev->queue_sel);
+ if (vdev->queue_sel >= VIRTIO_PCI_QUEUE_MAX) {
+ return -1;
+ }
qemu_get_be32s(f, &features);
if (virtio_set_features(vdev, features) < 0) {
--
1.9.1
- [Qemu-stable] [PATCH 015/108] virtio: validate num_sg when mapping, (continued)
- [Qemu-stable] [PATCH 015/108] virtio: validate num_sg when mapping, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 017/108] pxa2xx: avoid buffer overrun on incoming migration, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 020/108] tsc210x: fix buffer overrun on invalid state load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 019/108] ssd0323: fix buffer overun on invalid state load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 021/108] zaurus: fix buffer overrun on invalid state load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 024/108] target-arm: A64: fix unallocated test of scalar SQXTUN, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 018/108] ssi-sd: fix buffer overrun on invalid state load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 025/108] megasas: Implement LD_LIST_QUERY, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 022/108] usb: sanity check setup_index+setup_len in post_load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 023/108] virtio-scsi: fix buffer overrun on invalid state load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 014/108] virtio: avoid buffer overrun on incoming migration,
Michael Roth <=
- [Qemu-stable] [PATCH 029/108] po/Makefile: fix $SRC_PATH reference, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 027/108] block: Prevent coroutine stack overflow when recursing in bdrv_open_backing_file., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 028/108] s390x: empty function stubs in preparation for __KVM_HAVE_GUEST_DEBUG, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 016/108] openpic: avoid buffer overrun on incoming migration, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 030/108] acpi: fix tables for no-hpet configuration, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 031/108] stellaris_enet: block migration, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 033/108] target-i386: fix set of registers zeroed on reset, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 032/108] s390x/kvm: rework KVM synchronize to tracing for some ONEREGS, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 035/108] target-arm: A64: Handle blr lr, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 036/108] target-arm: Make vbar_write 64bit friendly on 32bit hosts, Michael Roth, 2014/08/06