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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a7c4c0d934c6cbc58de262d090d4a715445453f0@git.kernel.org>
Date:	Mon, 16 Nov 2009 22:06:56 GMT
From:	"tip-bot for H. Peter Anvin" <hpa@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	kees.cook@...onical.com, tglx@...utronix.de, rjw@...k.pl,
	nigel@...onice.net, pavel@....cz
Subject: [tip:x86/mm] x86, sleep: Always save the value of EFER

Commit-ID:  a7c4c0d934c6cbc58de262d090d4a715445453f0
Gitweb:     http://git.kernel.org/tip/a7c4c0d934c6cbc58de262d090d4a715445453f0
Author:     H. Peter Anvin <hpa@...or.com>
AuthorDate: Fri, 13 Nov 2009 15:28:14 -0800
Committer:  H. Peter Anvin <hpa@...or.com>
CommitDate: Mon, 16 Nov 2009 13:44:57 -0800

x86, sleep: Always save the value of EFER

Always save the value of EFER, regardless of the state of NX.  Since
EFER may not actually exist, use rdmsr_safe() to do so.

v2: check the return value from rdmsr_safe() instead of relying on
    the output values being unchanged on error.

Signed-off-by: H. Peter Anvin <hpa@...or.com>
Acked-by: Rafael J. Wysocki <rjw@...k.pl>
Cc: Pavel Machek <pavel@....cz>
Cc: Nigel Cunningham <nigel@...onice.net>
LKML-Reference: <1258154897-6770-3-git-send-email-hpa@...or.com>
Acked-by: Kees Cook <kees.cook@...onical.com>
---
 arch/x86/kernel/acpi/sleep.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 4a41145..82e5086 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -78,12 +78,9 @@ int acpi_save_state_mem(void)
 #ifndef CONFIG_64BIT
 	store_gdt((struct desc_ptr *)&header->pmode_gdt);
 
-	header->pmode_efer_low = nx_enabled;
-	if (header->pmode_efer_low & 1) {
-		/* This is strange, why not save efer, always? */
-		rdmsr(MSR_EFER, header->pmode_efer_low,
-			header->pmode_efer_high);
-	}
+	if (rdmsr_safe(MSR_EFER, &header->pmode_efer_low,
+		       &header->pmode_efer_high))
+		header->pmode_efer_low = header->pmode_efer_high = 0;
 #endif /* !CONFIG_64BIT */
 
 	header->pmode_cr0 = read_cr0();
--
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