summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch b/meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch
new file mode 100644
index 0000000000..644459e5af
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2018-16867.patch
@@ -0,0 +1,49 @@
1From 61f87388af0af72ad61dee00ddd267b8047049f2 Mon Sep 17 00:00:00 2001
2From: Gerd Hoffmann <kraxel@redhat.com>
3Date: Mon, 3 Dec 2018 11:10:45 +0100
4Subject: [PATCH] usb-mtp: outlaw slashes in filenames
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Slash is unix directory separator, so they are not allowed in filenames.
10Note this also stops the classic escape via "../".
11
12Fixes: CVE-2018-16867
13Reported-by: Michael Hanselmann <public@hansmi.ch>
14Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
15Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
16Message-id: 20181203101045.27976-3-kraxel@redhat.com
17(cherry picked from commit c52d46e041b42bb1ee6f692e00a0abe37a9659f6)
18Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
19
20Upstream-Status: Backport
21CVE: CVE-2018-16867
22Affects: < 3.1.0
23
24Signed-off-by: Armin Kuster <akuster@mvista.com>
25
26---
27 hw/usb/dev-mtp.c | 6 ++++++
28 1 file changed, 6 insertions(+)
29
30diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
31index 1ded7ac..899c8a3 100644
32--- a/hw/usb/dev-mtp.c
33+++ b/hw/usb/dev-mtp.c
34@@ -1667,6 +1667,12 @@ static void usb_mtp_write_metadata(MTPState *s)
35
36 utf16_to_str(dataset->length, dataset->filename, filename);
37
38+ if (strchr(filename, '/')) {
39+ usb_mtp_queue_result(s, RES_PARAMETER_NOT_SUPPORTED, d->trans,
40+ 0, 0, 0, 0);
41+ return;
42+ }
43+
44 o = usb_mtp_object_lookup_name(p, filename, dataset->length);
45 if (o != NULL) {
46 next_handle = o->handle;
47--
482.7.4
49