]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0096-x86-entry-64-Remove-the-RESTORE_._REGS-infrastructur.patch
update ZFS to 0.7.4 + ARC hit rate cherry-pick
[pve-kernel.git] / patches / kernel / 0096-x86-entry-64-Remove-the-RESTORE_._REGS-infrastructur.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Andy Lutomirski <luto@kernel.org>
3 Date: Thu, 2 Nov 2017 00:59:06 -0700
4 Subject: [PATCH] x86/entry/64: Remove the RESTORE_..._REGS infrastructure
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 CVE-2017-5754
10
11 All users of RESTORE_EXTRA_REGS, RESTORE_C_REGS and such, and
12 REMOVE_PT_GPREGS_FROM_STACK are gone. Delete the macros.
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/c32672f6e47c561893316d48e06c7656b1039a36.1509609304.git.luto@kernel.org
22 Signed-off-by: Ingo Molnar <mingo@kernel.org>
23 (cherry picked from commit c39858de696f0cc160a544455e8403d663d577e9)
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 d248c62028c5467cd5a5ce06d344e3fb330da3ec)
27 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
28 ---
29 arch/x86/entry/calling.h | 52 ------------------------------------------------
30 1 file changed, 52 deletions(-)
31
32 diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h
33 index 0b9dd8123701..1895a685d3dd 100644
34 --- a/arch/x86/entry/calling.h
35 +++ b/arch/x86/entry/calling.h
36 @@ -141,16 +141,6 @@ For 32-bit we have the following conventions - kernel is built with
37 UNWIND_HINT_REGS offset=\offset
38 .endm
39
40 - .macro RESTORE_EXTRA_REGS offset=0
41 - movq 0*8+\offset(%rsp), %r15
42 - movq 1*8+\offset(%rsp), %r14
43 - movq 2*8+\offset(%rsp), %r13
44 - movq 3*8+\offset(%rsp), %r12
45 - movq 4*8+\offset(%rsp), %rbp
46 - movq 5*8+\offset(%rsp), %rbx
47 - UNWIND_HINT_REGS offset=\offset extra=0
48 - .endm
49 -
50 .macro POP_EXTRA_REGS
51 popq %r15
52 popq %r14
53 @@ -172,48 +162,6 @@ For 32-bit we have the following conventions - kernel is built with
54 popq %rdi
55 .endm
56
57 - .macro RESTORE_C_REGS_HELPER rstor_rax=1, rstor_rcx=1, rstor_r11=1, rstor_r8910=1, rstor_rdx=1
58 - .if \rstor_r11
59 - movq 6*8(%rsp), %r11
60 - .endif
61 - .if \rstor_r8910
62 - movq 7*8(%rsp), %r10
63 - movq 8*8(%rsp), %r9
64 - movq 9*8(%rsp), %r8
65 - .endif
66 - .if \rstor_rax
67 - movq 10*8(%rsp), %rax
68 - .endif
69 - .if \rstor_rcx
70 - movq 11*8(%rsp), %rcx
71 - .endif
72 - .if \rstor_rdx
73 - movq 12*8(%rsp), %rdx
74 - .endif
75 - movq 13*8(%rsp), %rsi
76 - movq 14*8(%rsp), %rdi
77 - UNWIND_HINT_IRET_REGS offset=16*8
78 - .endm
79 - .macro RESTORE_C_REGS
80 - RESTORE_C_REGS_HELPER 1,1,1,1,1
81 - .endm
82 - .macro RESTORE_C_REGS_EXCEPT_RAX
83 - RESTORE_C_REGS_HELPER 0,1,1,1,1
84 - .endm
85 - .macro RESTORE_C_REGS_EXCEPT_RCX
86 - RESTORE_C_REGS_HELPER 1,0,1,1,1
87 - .endm
88 - .macro RESTORE_C_REGS_EXCEPT_R11
89 - RESTORE_C_REGS_HELPER 1,1,0,1,1
90 - .endm
91 - .macro RESTORE_C_REGS_EXCEPT_RCX_R11
92 - RESTORE_C_REGS_HELPER 1,0,0,1,1
93 - .endm
94 -
95 - .macro REMOVE_PT_GPREGS_FROM_STACK addskip=0
96 - subq $-(15*8+\addskip), %rsp
97 - .endm
98 -
99 .macro icebp
100 .byte 0xf1
101 .endm
102 --
103 2.14.2
104