]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/extra/CVE-2016-2391-usb-ohci-avoid-multiple-eof-timers.patch
Fix CVE-2016-6490: virtio: check vring descriptor buffer length
[pve-qemu-kvm.git] / debian / patches / extra / CVE-2016-2391-usb-ohci-avoid-multiple-eof-timers.patch
CommitLineData
430fd895
TL
1From a0dad3b2a4841f70f96145a2f60ffd04e5d584ad Mon Sep 17 00:00:00 2001
2From: Prasad J Pandit <pjp@fedoraproject.org>
3Date: Tue, 16 Feb 2016 15:34:14 +0530
4Subject: [PATCH] usb: ohci avoid multiple eof timers
5
6When transitioning an OHCI controller to the OHCI_USB_OPERATIONAL
7state, it creates an eof timer object in 'ohci_bus_start'.
8It does not check if one already exists. This results in memory
9leakage and null dereference issue. Add a check to avoid it.
10
11Reported-by: Zuozhi Fzz <zuozhi.fzz@alibaba-inc.com>
12Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
13
14Conflicts:
15 hw/usb/hcd-ohci.c
16---
17 hw/usb/hcd-ohci.c | 10 ++++++++++
18 1 file changed, 10 insertions(+)
19
20diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
21index ffab561..ccd5ac4 100644
22--- a/hw/usb/hcd-ohci.c
23+++ b/hw/usb/hcd-ohci.c
24@@ -1348,6 +1348,16 @@ static void ohci_frame_boundary(void *opaque)
25 */
26 static int ohci_bus_start(OHCIState *ohci)
27 {
28+ if (!ohci->eof_timer) {
29+ ohci->eof_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
30+ ohci_frame_boundary, ohci);
31+ }
32+ if (!ohci->eof_timer) {
33+ trace_usb_ohci_bus_eof_timer_failed(ohci->name);
34+ ohci_die(ohci);
35+ return 0;
36+ }
37+
38 trace_usb_ohci_start(ohci->name);
39
40 /* Delay the first SOF event by one frame time as
41--
422.1.4
43