]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0086-x86-entry-64-Remove-the-restore_c_regs_and_iret-labe.patch
revert buggy SCSI error handler commit
[pve-kernel.git] / patches / kernel / 0086-x86-entry-64-Remove-the-restore_c_regs_and_iret-labe.patch
CommitLineData
321d628a
FG
1From befef5ef70f959cd51694298c4370557e5d846cf Mon Sep 17 00:00:00 2001
2From: Andy Lutomirski <luto@kernel.org>
3Date: Thu, 2 Nov 2017 00:58:58 -0700
633c5ed1 4Subject: [PATCH 086/242] x86/entry/64: Remove the restore_c_regs_and_iret
321d628a
FG
5 label
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10CVE-2017-5754
11
12The only user was the 64-bit opportunistic SYSRET failure path, and
13that path didn't really need it. This change makes the
14opportunistic SYSRET code a bit more straightforward and gets rid of
15the label.
16
17Signed-off-by: Andy Lutomirski <luto@kernel.org>
18Reviewed-by: Borislav Petkov <bp@suse.de>
19Cc: Borislav Petkov <bpetkov@suse.de>
20Cc: Brian Gerst <brgerst@gmail.com>
21Cc: Dave Hansen <dave.hansen@intel.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/be3006a7ad3326e3458cf1cc55d416252cbe1986.1509609304.git.luto@kernel.org
26Signed-off-by: Ingo Molnar <mingo@kernel.org>
27(cherry picked from commit 9da78ba6b47b46428cfdfc0851511ab29c869798)
28Signed-off-by: Andy Whitcroft <apw@canonical.com>
29Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
30(cherry picked from commit 629c8b858cbe72e88e7f44a8f10e1b434ab80721)
31Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
32---
33 arch/x86/entry/entry_64.S | 5 ++---
34 1 file changed, 2 insertions(+), 3 deletions(-)
35
36diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
37index 34adfe0221d2..fac354ddf056 100644
38--- a/arch/x86/entry/entry_64.S
39+++ b/arch/x86/entry/entry_64.S
40@@ -245,7 +245,6 @@ entry_SYSCALL64_slow_path:
41 call do_syscall_64 /* returns with IRQs disabled */
42
43 return_from_SYSCALL_64:
44- RESTORE_EXTRA_REGS
45 TRACE_IRQS_IRETQ /* we're about to change IF */
46
47 /*
48@@ -314,6 +313,7 @@ return_from_SYSCALL_64:
49 */
50 syscall_return_via_sysret:
51 /* rcx and r11 are already restored (see code above) */
52+ RESTORE_EXTRA_REGS
53 RESTORE_C_REGS_EXCEPT_RCX_R11
54 movq RSP(%rsp), %rsp
55 UNWIND_HINT_EMPTY
56@@ -321,7 +321,7 @@ syscall_return_via_sysret:
57
58 opportunistic_sysret_failed:
59 SWAPGS
60- jmp restore_c_regs_and_iret
61+ jmp restore_regs_and_iret
62 END(entry_SYSCALL_64)
63
64 ENTRY(stub_ptregs_64)
65@@ -638,7 +638,6 @@ retint_kernel:
66 */
67 GLOBAL(restore_regs_and_iret)
68 RESTORE_EXTRA_REGS
69-restore_c_regs_and_iret:
70 RESTORE_C_REGS
71 REMOVE_PT_GPREGS_FROM_STACK 8
72 INTERRUPT_RETURN
73--
742.14.2
75