lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b07b6ae9-4b57-4b40-b9bc-50c2c67f1d91@default>
Date:   Mon, 2 Jul 2018 23:49:54 -0700 (PDT)
From:   Zhenzhong Duan <zhenzhong.duan@...cle.com>
To:     <linux-kernel@...r.kernel.org>
Cc:     <mingo@...hat.com>, <x86@...nel.org>, <tglx@...utronix.de>,
        <srinivas.eeda@...cle.com>, <hpa@...or.com>
Subject: [PATCH] x86/mm/32: Initialize CR4 shadow before __flush_tlb_all()

In x86_32, __flush_tlb_all() may have read cr4 shadow before the
initialization of cr4 shadow in cpuinit().

Fix it by adding cr4_init_shadow() call ahead of __flush_tlb_all().

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@...cle.com>
Cc: Srinivas Reddy Eeda <srinivas.eeda@...cle.com>
---
 arch/x86/kernel/smpboot.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index c2f7d1d..db9656e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -221,6 +221,11 @@ static void notrace start_secondary(void *unused)
 #ifdef CONFIG_X86_32
 	/* switch away from the initial page table */
 	load_cr3(swapper_pg_dir);
+	/*
+	 * Initialize the CR4 shadow before doing anything that could
+	 * try to read it.
+	 */
+	cr4_init_shadow();
 	__flush_tlb_all();
 #endif
 	load_current_idt();
-- 
1.7.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ