]>
Commit | Line | Data |
---|---|---|
59d5af67 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
321d628a FG |
2 | From: Andy Lutomirski <luto@kernel.org> |
3 | Date: Thu, 2 Nov 2017 00:59:05 -0700 | |
59d5af67 FG |
4 | Subject: [PATCH] x86/entry/64: Use POP instead of MOV to restore regs on NMI |
5 | return | |
321d628a FG |
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 | This gets rid of the last user of the old RESTORE_..._REGS infrastructure. | |
13 | ||
14 | Signed-off-by: Andy Lutomirski <luto@kernel.org> | |
15 | Cc: Borislav Petkov <bpetkov@suse.de> | |
16 | Cc: Brian Gerst <brgerst@gmail.com> | |
17 | Cc: Dave Hansen <dave.hansen@intel.com> | |
18 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
19 | Cc: Peter Zijlstra <peterz@infradead.org> | |
20 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
21 | Link: http://lkml.kernel.org/r/652a260f17a160789bc6a41d997f98249b73e2ab.1509609304.git.luto@kernel.org | |
22 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
23 | (cherry picked from commit 471ee4832209e986029b9fabdaad57b1eecb856b) | |
24 | Signed-off-by: Andy Whitcroft <apw@canonical.com> | |
25 | Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> | |
26 | (cherry picked from commit 3c5771a43d8f00e53081871027fea891a091ff5e) | |
27 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
28 | --- | |
29 | arch/x86/entry/entry_64.S | 11 +++++++---- | |
30 | 1 file changed, 7 insertions(+), 4 deletions(-) | |
31 | ||
32 | diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S | |
33 | index 87be1cd1fa88..4eff3aca54ed 100644 | |
34 | --- a/arch/x86/entry/entry_64.S | |
35 | +++ b/arch/x86/entry/entry_64.S | |
36 | @@ -1572,11 +1572,14 @@ end_repeat_nmi: | |
37 | nmi_swapgs: | |
38 | SWAPGS_UNSAFE_STACK | |
39 | nmi_restore: | |
40 | - RESTORE_EXTRA_REGS | |
41 | - RESTORE_C_REGS | |
42 | + POP_EXTRA_REGS | |
43 | + POP_C_REGS | |
44 | ||
45 | - /* Point RSP at the "iret" frame. */ | |
46 | - REMOVE_PT_GPREGS_FROM_STACK 6*8 | |
47 | + /* | |
48 | + * Skip orig_ax and the "outermost" frame to point RSP at the "iret" | |
49 | + * at the "iret" frame. | |
50 | + */ | |
51 | + addq $6*8, %rsp | |
52 | ||
53 | /* | |
54 | * Clear "NMI executing". Set DF first so that we can easily | |
55 | -- | |
56 | 2.14.2 | |
57 |