summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch
blob: f1201f0613915ad21f1d8add6c21296ef674c08b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: Prasad J Pandit <address@hidden>

USB Ehci emulation supports host controller capability registers.
But its mmio '.write' function was missing, which lead to a null
pointer dereference issue. Add a do nothing 'ehci_caps_write'
definition to avoid it; Do nothing because capability registers
are Read Only(RO).

Reported-by: Zuozhi Fzz <address@hidden>
Signed-off-by: Prasad J Pandit <address@hidden>

Upstream-Status: Backport
https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05899.html

CVE: CVE-2016-2198
Signed-off-by: Armin Kuster <akuster@mvista.com>

---
 hw/usb/hcd-ehci.c | 6 ++++++
  1 file changed, 6 insertions(+)

Index: qemu-2.5.0/hw/usb/hcd-ehci.c
===================================================================
--- qemu-2.5.0.orig/hw/usb/hcd-ehci.c
+++ qemu-2.5.0/hw/usb/hcd-ehci.c
@@ -893,6 +893,11 @@ static uint64_t ehci_caps_read(void *ptr
     return s->caps[addr];
 }
 
+static void ehci_caps_write(void *ptr, hwaddr addr,
+                             uint64_t val, unsigned size)
+{
+}
+
 static uint64_t ehci_opreg_read(void *ptr, hwaddr addr,
                                 unsigned size)
 {
@@ -2310,6 +2315,7 @@ static void ehci_frame_timer(void *opaqu
 
 static const MemoryRegionOps ehci_mmio_caps_ops = {
     .read = ehci_caps_read,
+    .write = ehci_caps_write,
     .valid.min_access_size = 1,
     .valid.max_access_size = 4,
     .impl.min_access_size = 1,