]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0213-x86-dumpstack-Indicate-in-Oops-whether-PTI-is-config.patch
add objtool build fix
[pve-kernel.git] / patches / kernel / 0213-x86-dumpstack-Indicate-in-Oops-whether-PTI-is-config.patch
CommitLineData
321d628a
FG
1From c7ef01f56951b1c876069387c44e11575288f3d2 Mon Sep 17 00:00:00 2001
2From: Vlastimil Babka <vbabka@suse.cz>
3Date: Tue, 19 Dec 2017 22:33:46 +0100
b378f209 4Subject: [PATCH 213/233] x86/dumpstack: Indicate in Oops whether PTI is
321d628a
FG
5 configured and enabled
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10CVE-2017-5754
11
12CONFIG_PAGE_TABLE_ISOLATION is relatively new and intrusive feature that may
13still have some corner cases which could take some time to manifest and be
14fixed. It would be useful to have Oops messages indicate whether it was
15enabled for building the kernel, and whether it was disabled during boot.
16
17Example of fully enabled:
18
19 Oops: 0001 [#1] SMP PTI
20
21Example of enabled during build, but disabled during boot:
22
23 Oops: 0001 [#1] SMP NOPTI
24
25We can decide to remove this after the feature has been tested in the field
26long enough.
27
28[ tglx: Made it use boot_cpu_has() as requested by Borislav ]
29
30Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
31Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
32Reviewed-by: Eduardo Valentin <eduval@amazon.com>
33Acked-by: Dave Hansen <dave.hansen@intel.com>
34Cc: Andy Lutomirski <luto@kernel.org>
35Cc: Andy Lutomirsky <luto@kernel.org>
36Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
37Cc: Borislav Petkov <bp@alien8.de>
38Cc: Brian Gerst <brgerst@gmail.com>
39Cc: Dave Hansen <dave.hansen@linux.intel.com>
40Cc: David Laight <David.Laight@aculab.com>
41Cc: Denys Vlasenko <dvlasenk@redhat.com>
42Cc: Greg KH <gregkh@linuxfoundation.org>
43Cc: H. Peter Anvin <hpa@zytor.com>
44Cc: Josh Poimboeuf <jpoimboe@redhat.com>
45Cc: Juergen Gross <jgross@suse.com>
46Cc: Linus Torvalds <torvalds@linux-foundation.org>
47Cc: Peter Zijlstra <peterz@infradead.org>
48Cc: Will Deacon <will.deacon@arm.com>
49Cc: aliguori@amazon.com
50Cc: bpetkov@suse.de
51Cc: daniel.gruss@iaik.tugraz.at
52Cc: hughd@google.com
53Cc: jkosina@suse.cz
54Cc: keescook@google.com
55Signed-off-by: Ingo Molnar <mingo@kernel.org>
56(cherry picked from commit 5f26d76c3fd67c48806415ef8b1116c97beff8ba)
57Signed-off-by: Andy Whitcroft <apw@canonical.com>
58Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
59(cherry picked from commit 7edb91fcc96589ad6b80446ec3835f83ffabb710)
60Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
61---
62 arch/x86/kernel/dumpstack.c | 6 ++++--
63 1 file changed, 4 insertions(+), 2 deletions(-)
64
65diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
66index 2bdeb983b9d8..19a936e9b259 100644
67--- a/arch/x86/kernel/dumpstack.c
68+++ b/arch/x86/kernel/dumpstack.c
69@@ -298,11 +298,13 @@ int __die(const char *str, struct pt_regs *regs, long err)
70 unsigned long sp;
71 #endif
72 printk(KERN_DEFAULT
73- "%s: %04lx [#%d]%s%s%s%s\n", str, err & 0xffff, ++die_counter,
74+ "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter,
75 IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
76 IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
77 debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
78- IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "");
79+ IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "",
80+ IS_ENABLED(CONFIG_PAGE_TABLE_ISOLATION) ?
81+ (boot_cpu_has(X86_FEATURE_PTI) ? " PTI" : " NOPTI") : "");
82
83 if (notify_die(DIE_OOPS, str, regs, err,
84 current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)
85--
862.14.2
87