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>] [day] [month] [year] [list]
Date:	Sat, 20 Apr 2013 13:02:24 +0100
From:	Bryan O'Donoghue <bryan.odonoghue.lkml@...us-software.ie>
To:	hpa@...or.com, linux-kernel@...r.kernel.org, x86@...nel.org,
	fenghua.yu@...el.com, bp@...en8.de
Cc:	Bryan O'Donoghue <bryan.odonoghue.lkml@...us-software.ie>
Subject: [PATCH] x86: Add check for P5 to microcode_intel_early v2

Architectural MSRs associated with microcode are for P6 or higher.
Add a check to early microcode to detect < P6.

Without a check for < P6 - we end up reading from unimplemented MSRs
on Pentium.

Thanks to Borislav Petkov for suggestion on where to intercept the P5
resulting in fewer cycles and less code to accomplish the fix.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue.lkml@...us-software.ie>
---
 arch/x86/kernel/microcode_core_early.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/microcode_core_early.c b/arch/x86/kernel/microcode_core_early.c
index 577db84..bd251b3 100644
--- a/arch/x86/kernel/microcode_core_early.c
+++ b/arch/x86/kernel/microcode_core_early.c
@@ -50,8 +50,17 @@ static int __cpuinit x86_vendor(void)
 
 	native_cpuid(&eax, &ebx, &ecx, &edx);
 
-	if (CPUID_IS(CPUID_INTEL1, CPUID_INTEL2, CPUID_INTEL3, ebx, ecx, edx))
+	if (CPUID_IS(CPUID_INTEL1, CPUID_INTEL2, CPUID_INTEL3, ebx, ecx, edx)) {
+
+		eax = 0x00000001;
+		ecx = 0;
+		native_cpuid(&eax, &ebx, &ecx, &edx);
+
+		if (((edx >> 8) & 0xf) < 0x6)
+			return X86_VENDOR_UNKNOWN;
+
 		return X86_VENDOR_INTEL;
+	}
 
 	if (CPUID_IS(CPUID_AMD1, CPUID_AMD2, CPUID_AMD3, ebx, ecx, edx))
 		return X86_VENDOR_AMD;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ