]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kaiser: name that 0x1000 KAISER_SHADOW_PGD_OFFSET
authorHugh Dickins <hughd@google.com>
Sun, 10 Sep 2017 00:31:18 +0000 (17:31 -0700)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Fri, 12 Jan 2018 18:20:07 +0000 (10:20 -0800)
There's a 0x1000 in various places, which looks better with a name.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit aeda21d77e22fb382c51fd3f6bbb18df69bc032f)
Orabug: 27333760
CVE: CVE-2017-5754
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Conflicts:
arch/x86/entry/entry_64.S (not in this tree)
arch/x86/kernel/entry_64.S (patched instead of that)

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
arch/x86/include/asm/kaiser.h
arch/x86/kernel/entry_64.S

index 7394ba9f995107070dfbb1fe79ca6721a537d180..051acf678cda3761c893ddc501b46ea3c93801a9 100644 (file)
  * A minimalistic kernel mapping holds the parts needed to be mapped in user
  * mode, such as the entry/exit functions of the user space, or the stacks.
  */
+
+#define KAISER_SHADOW_PGD_OFFSET 0x1000
+
 #ifdef __ASSEMBLY__
 #ifdef CONFIG_KAISER
 
 .macro _SWITCH_TO_KERNEL_CR3 reg
 movq %cr3, \reg
 #ifdef CONFIG_KAISER_REAL_SWITCH
-andq $(~0x1000), \reg
+andq $(~KAISER_SHADOW_PGD_OFFSET), \reg
 #endif
 movq \reg, %cr3
 .endm
@@ -27,7 +30,7 @@ movq \reg, %cr3
 .macro _SWITCH_TO_USER_CR3 reg
 movq %cr3, \reg
 #ifdef CONFIG_KAISER_REAL_SWITCH
-orq $(0x1000), \reg
+orq $(KAISER_SHADOW_PGD_OFFSET), \reg
 #endif
 movq \reg, %cr3
 .endm
index 070a609dec77488fca71aea455b5e93cb007dbb1..d8227679b586c32484c757db2f6a14f8d0bc2a6d 100644 (file)
@@ -1725,7 +1725,7 @@ ENTRY(nmi)
        movq    %cr3, %rax
        pushq   %rax
 #ifdef CONFIG_KAISER_REAL_SWITCH
-       andq    $(~0x1000), %rax
+       andq    $(~KAISER_SHADOW_PGD_OFFSET), %rax
 #endif
        movq    %rax, %cr3
 #endif
@@ -1963,7 +1963,7 @@ end_repeat_nmi:
        movq    %cr3, %rax
        pushq   %rax
 #ifdef CONFIG_KAISER_REAL_SWITCH
-       andq    $(~0x1000), %rax
+       andq    $(~KAISER_SHADOW_PGD_OFFSET), %rax
 #endif
        movq    %rax, %cr3
 #endif