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:   Fri, 18 May 2018 00:33:43 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     tglx@...utronix.de, mingo@...hat.com, hpa@...or.com
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] x86: verify_cpu: restore flags later

	popf
	xor	eax, eax

formally doesn't restore flags because XOR clobber flags.

Do POPF as last instruction and rearrange the other case for symmetry.

Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---

 arch/x86/kernel/verify_cpu.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/x86/kernel/verify_cpu.S
+++ b/arch/x86/kernel/verify_cpu.S
@@ -132,11 +132,11 @@ ENTRY(verify_cpu)
 	jmp	.Lverify_cpu_sse_test	# try again
 
 .Lverify_cpu_no_longmode:
-	popf				# Restore caller passed flags
 	movl $1,%eax
+	popf				# Restore caller passed flags
 	ret
 .Lverify_cpu_sse_ok:
-	popf				# Restore caller passed flags
 	xorl %eax, %eax
+	popf				# Restore caller passed flags
 	ret
 ENDPROC(verify_cpu)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ