]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0167-x86-vsyscall-64-Warn-and-fail-vsyscall-emulation-in-.patch
add objtool build fix
[pve-kernel.git] / patches / kernel / 0167-x86-vsyscall-64-Warn-and-fail-vsyscall-emulation-in-.patch
1 From e8354b2be6f97e97515021452082436cec8857ea Mon Sep 17 00:00:00 2001
2 From: Andy Lutomirski <luto@kernel.org>
3 Date: Sun, 10 Dec 2017 22:47:20 -0800
4 Subject: [PATCH 167/233] x86/vsyscall/64: Warn and fail vsyscall emulation in
5 NATIVE mode
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 CVE-2017-5754
11
12 If something goes wrong with pagetable setup, vsyscall=native will
13 accidentally fall back to emulation. Make it warn and fail so that we
14 notice.
15
16 Signed-off-by: Andy Lutomirski <luto@kernel.org>
17 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 Cc: Borislav Petkov <bp@alien8.de>
19 Cc: Brian Gerst <brgerst@gmail.com>
20 Cc: Dave Hansen <dave.hansen@linux.intel.com>
21 Cc: David Laight <David.Laight@aculab.com>
22 Cc: H. Peter Anvin <hpa@zytor.com>
23 Cc: Josh Poimboeuf <jpoimboe@redhat.com>
24 Cc: Juergen Gross <jgross@suse.com>
25 Cc: Kees Cook <keescook@chromium.org>
26 Cc: Linus Torvalds <torvalds@linux-foundation.org>
27 Cc: Peter Zijlstra <peterz@infradead.org>
28 Signed-off-by: Ingo Molnar <mingo@kernel.org>
29 (cherry picked from commit 4831b779403a836158917d59a7ca880483c67378)
30 Signed-off-by: Andy Whitcroft <apw@canonical.com>
31 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
32 (cherry picked from commit ba10c7488b12c3106d79c8b2ba3f4e79c7e40ee4)
33 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
34 ---
35 arch/x86/entry/vsyscall/vsyscall_64.c | 4 ++++
36 1 file changed, 4 insertions(+)
37
38 diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
39 index 91f3133cf5f1..5e56a4ced848 100644
40 --- a/arch/x86/entry/vsyscall/vsyscall_64.c
41 +++ b/arch/x86/entry/vsyscall/vsyscall_64.c
42 @@ -138,6 +138,10 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
43
44 WARN_ON_ONCE(address != regs->ip);
45
46 + /* This should be unreachable in NATIVE mode. */
47 + if (WARN_ON(vsyscall_mode == NATIVE))
48 + return false;
49 +
50 if (vsyscall_mode == NONE) {
51 warn_bad_vsyscall(KERN_INFO, regs,
52 "vsyscall attempted with vsyscall=none");
53 --
54 2.14.2
55