[Devel] [PATCH RHEL7 COMMIT] ms/x86/asm/64: Clear AC on NMI entries

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 16 15:29:42 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.14.4.vz7.72.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.14.4.vz7.72.8
------>
commit 10180996c612fa4e92be1ae5f93bf49afeff271b
Author: Andy Lutomirski <luto at kernel.org>
Date:   Tue Oct 16 15:29:39 2018 +0300

    ms/x86/asm/64: Clear AC on NMI entries
    
    This closes a hole in our SMAP implementation.
    
    This patch comes from grsecurity. Good catch!
    
    Signed-off-by: Andy Lutomirski <luto at kernel.org>
    Cc: Borislav Petkov <bp at alien8.de>
    Cc: Brian Gerst <brgerst at gmail.com>
    Cc: Denys Vlasenko <dvlasenk at redhat.com>
    Cc: H. Peter Anvin <hpa at zytor.com>
    Cc: Josh Poimboeuf <jpoimboe at redhat.com>
    Cc: Linus Torvalds <torvalds at linux-foundation.org>
    Cc: Peter Zijlstra <peterz at infradead.org>
    Cc: Thomas Gleixner <tglx at linutronix.de>
    Cc: stable at vger.kernel.org
    Link: http://lkml.kernel.org/r/314cc9f294e8f14ed85485727556ad4f15bb1659.1502159503.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <mingo at kernel.org>
    (cherry picked from commit e93c17301ac55321fc18e0f8316e924e58a83c8c)
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 arch/x86/kernel/entry_64.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 173b765483d3..0dbf26ded7fb 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1640,6 +1640,8 @@ ENTRY(nmi)
 	 * other IST entries.
 	 */
 
+	ASM_CLAC
+
 	/* Use %rsi as out temp variable throughout */
 	pushq_cfi %rsi
 	CFI_REL_OFFSET rsi, 0



More information about the Devel mailing list