CVE-2016-9603: cirrus: heap buffer overflow via vnc connection (bz #1432040) CVE-2017-7377: 9pfs: fix file descriptor leak (bz #1437872) CVE-2017-7980: cirrus: OOB r/w access issues in bitblt (bz #1444372) CVE-2017-8112: vmw_pvscsi: infinite loop in pvscsi_log2 (bz #1445622) CVE-2017-8309: audio: host memory lekage via capture buffer (bz #1446520) CVE-2017-8379: input: host memory lekage via keyboard events (bz #1446560) CVE-2017-8380: scsi: megasas: out-of-bounds read in megasas_mmio_write (bz #1446578) CVE-2017-9060: virtio-gpu: host memory leakage in Virtio GPU device (bz #1452598) CVE-2017-9310: net: infinite loop in e1000e NIC emulation (bz #1452623) CVE-2017-9330: usb: ohci: infinite loop due to incorrect return value (bz #1457699) CVE-2017-9374: usb: ehci host memory leakage during hotunplug (bz #1459137) CVE-2017-10806: usb-redirect: stack buffer overflow in debug logging (bz #1468497)
36 lines
1.3 KiB
Diff
36 lines
1.3 KiB
Diff
From: Prasad J Pandit <pjp@fedoraproject.org>
|
|
Date: Mon, 19 Sep 2016 23:55:45 +0530
|
|
Subject: [PATCH] virtio: add check for descriptor's mapped address
|
|
|
|
virtio back end uses set of buffers to facilitate I/O operations.
|
|
If its size is too large, 'cpu_physical_memory_map' could return
|
|
a null address. This would result in a null dereference while
|
|
un-mapping descriptors. Add check to avoid it.
|
|
|
|
Reported-by: Qinghao Tang <luodalongde@gmail.com>
|
|
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
(cherry picked from commit 973e7170dddefb491a48df5cba33b2ae151013a0)
|
|
---
|
|
hw/virtio/virtio.c | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
|
|
index f31140aba4..58edd9952a 100644
|
|
--- a/hw/virtio/virtio.c
|
|
+++ b/hw/virtio/virtio.c
|
|
@@ -473,6 +473,11 @@ static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iove
|
|
}
|
|
|
|
iov[num_sg].iov_base = cpu_physical_memory_map(pa, &len, is_write);
|
|
+ if (!iov[num_sg].iov_base) {
|
|
+ error_report("virtio: bogus descriptor or out of resources");
|
|
+ exit(1);
|
|
+ }
|
|
+
|
|
iov[num_sg].iov_len = len;
|
|
addr[num_sg] = pa;
|
|
|