]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0058-x86-xen-Add-unwind-hint-annotations.patch
KPTI: add follow-up fixes
[pve-kernel.git] / patches / kernel / 0058-x86-xen-Add-unwind-hint-annotations.patch
CommitLineData
321d628a
FG
1From b90136e442c889a7344992acc34764729936ab92 Mon Sep 17 00:00:00 2001
2From: Josh Poimboeuf <jpoimboe@redhat.com>
3Date: Mon, 18 Sep 2017 21:43:36 -0500
e4cdf2a5 4Subject: [PATCH 058/241] x86/xen: Add unwind hint annotations
321d628a
FG
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11Add unwind hint annotations to the xen head code so the ORC unwinder can
12read head_64.o.
13
14hypercall_page needs empty annotations at 32-byte intervals to match the
15'xen_hypercall_*' ELF functions at those locations.
16
17Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
18Cc: Andy Lutomirski <luto@kernel.org>
19Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
20Cc: Jiri Slaby <jslaby@suse.cz>
21Cc: Juergen Gross <jgross@suse.com>
22Cc: Linus Torvalds <torvalds@linux-foundation.org>
23Cc: Peter Zijlstra <peterz@infradead.org>
24Cc: Thomas Gleixner <tglx@linutronix.de>
25Link: http://lkml.kernel.org/r/70ed2eb516fe9266be766d953f93c2571bca88cc.1505764066.git.jpoimboe@redhat.com
26Signed-off-by: Ingo Molnar <mingo@kernel.org>
27(cherry picked from commit abbe1cac6214d81d2f4e149aba64a8760703144e)
28Signed-off-by: Andy Whitcroft <apw@canonical.com>
29Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
30(cherry picked from commit 9f099a90cb39eaff9b3187e8a6d8151c8af53db1)
31Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
32---
33 arch/x86/xen/xen-head.S | 7 ++++++-
34 1 file changed, 6 insertions(+), 1 deletion(-)
35
36diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
37index 2f0cff2cc265..ad189ab2c329 100644
38--- a/arch/x86/xen/xen-head.S
39+++ b/arch/x86/xen/xen-head.S
40@@ -9,6 +9,7 @@
41 #include <asm/boot.h>
42 #include <asm/asm.h>
43 #include <asm/page_types.h>
44+#include <asm/unwind_hints.h>
45
46 #include <xen/interface/elfnote.h>
47 #include <xen/interface/features.h>
48@@ -19,6 +20,7 @@
49 #ifdef CONFIG_XEN_PV
50 __INIT
51 ENTRY(startup_xen)
52+ UNWIND_HINT_EMPTY
53 cld
54
55 /* Clear .bss */
56@@ -40,7 +42,10 @@ END(startup_xen)
57 .pushsection .text
58 .balign PAGE_SIZE
59 ENTRY(hypercall_page)
60- .skip PAGE_SIZE
61+ .rept (PAGE_SIZE / 32)
62+ UNWIND_HINT_EMPTY
63+ .skip 32
64+ .endr
65
66 #define HYPERCALL(n) \
67 .equ xen_hypercall_##n, hypercall_page + __HYPERVISOR_##n * 32; \
68--
692.14.2
70