| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- From e8354b2be6f97e97515021452082436cec8857ea Mon Sep 17 00:00:00 2001
- From: Andy Lutomirski <[email protected]>
- Date: Sun, 10 Dec 2017 22:47:20 -0800
- Subject: [PATCH 167/232] x86/vsyscall/64: Warn and fail vsyscall emulation in
- NATIVE mode
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5754
- If something goes wrong with pagetable setup, vsyscall=native will
- accidentally fall back to emulation. Make it warn and fail so that we
- notice.
- Signed-off-by: Andy Lutomirski <[email protected]>
- Signed-off-by: Thomas Gleixner <[email protected]>
- Cc: Borislav Petkov <[email protected]>
- Cc: Brian Gerst <[email protected]>
- Cc: Dave Hansen <[email protected]>
- Cc: David Laight <[email protected]>
- Cc: H. Peter Anvin <[email protected]>
- Cc: Josh Poimboeuf <[email protected]>
- Cc: Juergen Gross <[email protected]>
- Cc: Kees Cook <[email protected]>
- Cc: Linus Torvalds <[email protected]>
- Cc: Peter Zijlstra <[email protected]>
- Signed-off-by: Ingo Molnar <[email protected]>
- (cherry picked from commit 4831b779403a836158917d59a7ca880483c67378)
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit ba10c7488b12c3106d79c8b2ba3f4e79c7e40ee4)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- arch/x86/entry/vsyscall/vsyscall_64.c | 4 ++++
- 1 file changed, 4 insertions(+)
- diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
- index 91f3133cf5f1..5e56a4ced848 100644
- --- a/arch/x86/entry/vsyscall/vsyscall_64.c
- +++ b/arch/x86/entry/vsyscall/vsyscall_64.c
- @@ -138,6 +138,10 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
-
- WARN_ON_ONCE(address != regs->ip);
-
- + /* This should be unreachable in NATIVE mode. */
- + if (WARN_ON(vsyscall_mode == NATIVE))
- + return false;
- +
- if (vsyscall_mode == NONE) {
- warn_bad_vsyscall(KERN_INFO, regs,
- "vsyscall attempted with vsyscall=none");
- --
- 2.14.2
|