Skip to contentSkip to conversation

qemu: Several CVE fixes

PATCH New Armin Kuster 1 participant 1 message May 29, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu: Several CVE fixes

From: Armin Kuster <[email protected]>

Source: qemu.org
MR: 97258, 97342, 97438, 97443
Type: Security Fix
Disposition: Backport from git.qemu.org/qemu.git
ChangeID: a5e9fd03ca5bebc880dcc3c4567e10a9ae47dba5 Description:

These issues affect qemu < 3.1.0

Fixes:
CVE-2018-16867
CVE-2018-16872
CVE-2018-18849
CVE-2018-19364

---
 .../qemu/qemu/CVE-2018-16867.patch                 |  49 +++++++++
 .../qemu/qemu/CVE-2018-16872.patch                 |  89 ++++++++++++++++
 .../qemu/qemu/CVE-2018-18849.patch                 |  86 +++++++++++++++
 .../qemu/qemu/CVE-2018-19364_p1.patch              |  51 +++++++++
 .../qemu/qemu/CVE-2018-19364_p2.patch              | 115 +++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_3.0.0.bb           |   5 +
 6 files changed, 395 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2018-16872.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2018-18849.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2018-19364_p1.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2018-19364_p2.patch
meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch new file +49 -0
new file mode 100644
index 0000000..644459e
@@ -0,0 +1,49 @@
+From 61f87388af0af72ad61dee00ddd267b8047049f2 Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <[email protected]>
+Date: Mon, 3 Dec 2018 11:10:45 +0100
+Subject: [PATCH] usb-mtp: outlaw slashes in filenames
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Slash is unix directory separator, so they are not allowed in filenames.
+Note this also stops the classic escape via "../".
+
+Fixes: CVE-2018-16867
+Reported-by: Michael Hanselmann <[email protected]>
+Signed-off-by: Gerd Hoffmann <[email protected]>
+Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
+Message-id: [email protected]
+(cherry picked from commit c52d46e041b42bb1ee6f692e00a0abe37a9659f6)
+Signed-off-by: Michael Roth <[email protected]>
+
+Upstream-Status: Backport
+CVE: CVE-2018-16867
+Affects: < 3.1.0
+
+Signed-off-by: Armin Kuster <[email protected]>
+
+---
+ hw/usb/dev-mtp.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
+index 1ded7ac..899c8a3 100644
+--- a/hw/usb/dev-mtp.c
++++ b/hw/usb/dev-mtp.c
+@@ -1667,6 +1667,12 @@ static void usb_mtp_write_metadata(MTPState *s)
+ 
+     utf16_to_str(dataset->length, dataset->filename, filename);
+ 
++    if (strchr(filename, '/')) {
++        usb_mtp_queue_result(s, RES_PARAMETER_NOT_SUPPORTED, d->trans,
++                             0, 0, 0, 0);
++        return;
++    }
++
+     o = usb_mtp_object_lookup_name(p, filename, dataset->length);
+     if (o != NULL) {
+         next_handle = o->handle;
+-- 
+2.7.4
+
meta/recipes-devtools/qemu/qemu/CVE-2018-16872.patch new file +89 -0

89 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu/CVE-2018-18849.patch new file +86 -0

86 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu/CVE-2018-19364_p1.patch new file +51 -0

51 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu/CVE-2018-19364_p2.patch new file +115 -0

115 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu_3.0.0.bb +5 -0
index 776548b..59cfc38 100644
@@ -25,6 +25,11 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://CVE-2018-17958.patch \
            file://CVE-2018-17962.patch \
            file://CVE-2018-17963.patch \
+           file://CVE-2018-16867.patch \
+           file://CVE-2018-16872.patch \
+           file://CVE-2018-18849.patch \
+           file://CVE-2018-19364_p1.patch \
+           file://CVE-2018-19364_p2.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
Signature · 1 line
2.7.4