Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1 | From: Prasad J Pandit <address@hidden> |
| 2 | |
| 3 | USB Ehci emulation supports host controller capability registers. |
| 4 | But its mmio '.write' function was missing, which lead to a null |
| 5 | pointer dereference issue. Add a do nothing 'ehci_caps_write' |
| 6 | definition to avoid it; Do nothing because capability registers |
| 7 | are Read Only(RO). |
| 8 | |
| 9 | Reported-by: Zuozhi Fzz <address@hidden> |
| 10 | Signed-off-by: Prasad J Pandit <address@hidden> |
| 11 | |
| 12 | Upstream-Status: Backport |
| 13 | https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05899.html |
| 14 | |
| 15 | CVE: CVE-2016-2198 |
| 16 | Signed-off-by: Armin Kuster <akuster@mvista.com> |
| 17 | |
| 18 | --- |
| 19 | hw/usb/hcd-ehci.c | 6 ++++++ |
| 20 | 1 file changed, 6 insertions(+) |
| 21 | |
| 22 | Index: qemu-2.5.0/hw/usb/hcd-ehci.c |
| 23 | =================================================================== |
| 24 | --- qemu-2.5.0.orig/hw/usb/hcd-ehci.c |
| 25 | +++ qemu-2.5.0/hw/usb/hcd-ehci.c |
| 26 | @@ -893,6 +893,11 @@ static uint64_t ehci_caps_read(void *ptr |
| 27 | return s->caps[addr]; |
| 28 | } |
| 29 | |
| 30 | +static void ehci_caps_write(void *ptr, hwaddr addr, |
| 31 | + uint64_t val, unsigned size) |
| 32 | +{ |
| 33 | +} |
| 34 | + |
| 35 | static uint64_t ehci_opreg_read(void *ptr, hwaddr addr, |
| 36 | unsigned size) |
| 37 | { |
| 38 | @@ -2310,6 +2315,7 @@ static void ehci_frame_timer(void *opaqu |
| 39 | |
| 40 | static const MemoryRegionOps ehci_mmio_caps_ops = { |
| 41 | .read = ehci_caps_read, |
| 42 | + .write = ehci_caps_write, |
| 43 | .valid.min_access_size = 1, |
| 44 | .valid.max_access_size = 4, |
| 45 | .impl.min_access_size = 1, |