diff options
| author | Sona Sarmadi <sona.sarmadi@enea.com> | 2017-08-29 10:29:29 +0200 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2017-08-29 13:32:30 +0200 |
| commit | 534a1c7f012e2099ce83bcab35c25cd587c9f3af (patch) | |
| tree | e3a7ba782deced84ceb7e8be02c602aab49ca120 /recipes-devtools | |
| parent | 4c3b48e94915ea1e62f5364fe4261359cf99a8e7 (diff) | |
| download | meta-el-common-534a1c7f012e2099ce83bcab35c25cd587c9f3af.tar.gz | |
qemu: CVE-2017-6505
Quick Emulator built with the USB OHCI Emulation support is vulnerable to an
infinite loop issue. It could occur while processing an endpoint list
descriptor in ohci_service_ed_list().
A guest user/process could use this flaw to crash Qemu process resulting in DoS.
References:
==========
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2017-6505
Upstream patch:
http://git.qemu-project.org/?p=qemu.git;a=commitdiff;h=95ed56939eb2eaa4e2f349fe6dcd13ca4edfd8fb
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'recipes-devtools')
| -rw-r--r-- | recipes-devtools/qemu/qemu/CVE-2017-6505.patch | 56 | ||||
| -rw-r--r-- | recipes-devtools/qemu/qemu_%.bbappend | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/recipes-devtools/qemu/qemu/CVE-2017-6505.patch b/recipes-devtools/qemu/qemu/CVE-2017-6505.patch new file mode 100644 index 0000000..a939e85 --- /dev/null +++ b/recipes-devtools/qemu/qemu/CVE-2017-6505.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | From 95ed56939eb2eaa4e2f349fe6dcd13ca4edfd8fb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Li Qiang <liqiang6-s@360.cn> | ||
| 3 | Date: Tue, 7 Feb 2017 02:23:33 -0800 | ||
| 4 | Subject: [PATCH] usb: ohci: limit the number of link eds | ||
| 5 | |||
| 6 | The guest may builds an infinite loop with link eds. This patch | ||
| 7 | limit the number of linked ed to avoid this. | ||
| 8 | |||
| 9 | CVE: CVE-2017-6505 | ||
| 10 | Upstream-Status: Backport [backport from v2.9.0-rc0~85^2~8] | ||
| 11 | |||
| 12 | Signed-off-by: Li Qiang <liqiang6-s@360.cn> | ||
| 13 | Message-id: 5899a02e.45ca240a.6c373.93c1@mx.google.com | ||
| 14 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
| 15 | Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> | ||
| 16 | --- | ||
| 17 | hw/usb/hcd-ohci.c | 9 ++++++++- | ||
| 18 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c | ||
| 21 | index 2cba3e3..21c93e0 100644 | ||
| 22 | --- a/hw/usb/hcd-ohci.c | ||
| 23 | +++ b/hw/usb/hcd-ohci.c | ||
| 24 | @@ -42,6 +42,8 @@ | ||
| 25 | |||
| 26 | #define OHCI_MAX_PORTS 15 | ||
| 27 | |||
| 28 | +#define ED_LINK_LIMIT 4 | ||
| 29 | + | ||
| 30 | static int64_t usb_frame_time; | ||
| 31 | static int64_t usb_bit_time; | ||
| 32 | |||
| 33 | @@ -1184,7 +1186,7 @@ static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion) | ||
| 34 | uint32_t next_ed; | ||
| 35 | uint32_t cur; | ||
| 36 | int active; | ||
| 37 | - | ||
| 38 | + uint32_t link_cnt = 0; | ||
| 39 | active = 0; | ||
| 40 | |||
| 41 | if (head == 0) | ||
| 42 | @@ -1199,6 +1201,11 @@ static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion) | ||
| 43 | |||
| 44 | next_ed = ed.next & OHCI_DPTR_MASK; | ||
| 45 | |||
| 46 | + if (++link_cnt > ED_LINK_LIMIT) { | ||
| 47 | + ohci_die(ohci); | ||
| 48 | + return 0; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | if ((ed.head & OHCI_ED_H) || (ed.flags & OHCI_ED_K)) { | ||
| 52 | uint32_t addr; | ||
| 53 | /* Cancel pending packets for ED that have been paused. */ | ||
| 54 | -- | ||
| 55 | 1.9.1 | ||
| 56 | |||
diff --git a/recipes-devtools/qemu/qemu_%.bbappend b/recipes-devtools/qemu/qemu_%.bbappend index 8a73d1f..8db32c5 100644 --- a/recipes-devtools/qemu/qemu_%.bbappend +++ b/recipes-devtools/qemu/qemu_%.bbappend | |||
| @@ -4,4 +4,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | |||
| 4 | SRC_URI += "file://0001-CVE-2017-2620.patch \ | 4 | SRC_URI += "file://0001-CVE-2017-2620.patch \ |
| 5 | file://0002-CVE-2017-2620.patch \ | 5 | file://0002-CVE-2017-2620.patch \ |
| 6 | file://CVE-2017-7471.patch \ | 6 | file://CVE-2017-7471.patch \ |
| 7 | file://CVE-2017-6505.patch \ | ||
| 7 | " | 8 | " |
