summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2018-09-10 09:48:53 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-11 09:05:35 +0100
commitf3fb768200b1f4710ed485037f9849d635905c6d (patch)
tree7fd1acb9879566207d333738ffbac21b4d3c95ee
parent735e066b1cfa71bf552004cf24d528e0411b5c52 (diff)
downloadpoky-f3fb768200b1f4710ed485037f9849d635905c6d.tar.gz
qemu: patch for CVE-2018-15746
(From OE-Core rev: 8c02e508dc861ee95a66f3f685d24518a699685b) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2018-15746.patch64
-rw-r--r--meta/recipes-devtools/qemu/qemu_3.0.0.bb1
2 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2018-15746.patch b/meta/recipes-devtools/qemu/qemu/CVE-2018-15746.patch
new file mode 100644
index 0000000000..2f61ea0051
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2018-15746.patch
@@ -0,0 +1,64 @@
1From 9acf4c64dd4560bd268006d7356c7455fab7e5b1 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 6 Sep 2018 14:52:12 +0800
4Subject: [PATCH] seccomp: set the seccomp filter to all threads
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9When using "-seccomp on", the seccomp policy is only applied to the
10main thread, the vcpu worker thread and other worker threads created
11after seccomp policy is applied; the seccomp policy is not applied to
12e.g. the RCU thread because it is created before the seccomp policy is
13applied and SECCOMP_FILTER_FLAG_TSYNC isn't used.
14
15This can be verified with
16for task in /proc/`pidof qemu`/task/*; do cat $task/status | grep Secc ; done
17Seccomp: 2
18Seccomp: 0
19Seccomp: 0
20Seccomp: 2
21Seccomp: 2
22Seccomp: 2
23
24Starting with libseccomp 2.2.0 and kernel >= 3.17, we can use
25seccomp_attr_set(ctx, > SCMP_FLTATR_CTL_TSYNC, 1) to update the policy
26on all threads.
27
28libseccomp requirement was bumped to 2.2.0 in previous patch.
29libseccomp should fail to set the filter if it can't honour
30SCMP_FLTATR_CTL_TSYNC (untested), and thus -sandbox will now fail on
31kernel < 3.17.
32
33Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
34Acked-by: Eduardo Otubo <otubo@redhat.com>
35
36Upstream-Status: Backport[https://github.com/qemu/qemu/commit/
3770dfabeaa79ba4d7a3b699abe1a047c8012db114#diff-18106d3b47a2d249f9d41e772b7db22d]
38
39CVE: CVE-2018-15746
40
41Signed-off-by: Changqing Li <changqing.li@windriver.com>
42---
43 qemu-seccomp.c | 5 +++++
44 1 file changed, 5 insertions(+)
45
46diff --git a/qemu-seccomp.c b/qemu-seccomp.c
47index 9cd8eb9..ba5500a 100644
48--- a/qemu-seccomp.c
49+++ b/qemu-seccomp.c
50@@ -120,6 +120,11 @@ static int seccomp_start(uint32_t seccomp_opts)
51 goto seccomp_return;
52 }
53
54+ rc = seccomp_attr_set(ctx, SCMP_FLTATR_CTL_TSYNC, 1);
55+ if (rc != 0) {
56+ goto seccomp_return;
57+ }
58+
59 for (i = 0; i < ARRAY_SIZE(blacklist); i++) {
60 if (!(seccomp_opts & blacklist[i].set)) {
61 continue;
62--
632.7.4
64
diff --git a/meta/recipes-devtools/qemu/qemu_3.0.0.bb b/meta/recipes-devtools/qemu/qemu_3.0.0.bb
index 588db7fd6a..4569caec2f 100644
--- a/meta/recipes-devtools/qemu/qemu_3.0.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_3.0.0.bb
@@ -21,6 +21,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
21 file://0009-apic-fixup-fallthrough-to-PIC.patch \ 21 file://0009-apic-fixup-fallthrough-to-PIC.patch \
22 file://0010-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ 22 file://0010-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \
23 file://0011-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \ 23 file://0011-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \
24 file://CVE-2018-15746.patch \
24 " 25 "
25UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" 26UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
26 27