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] [day] [month] [year] [list]
Message-ID: <tip-a4733143085d6c782ac1e6c85778655b6bac1d4e@git.kernel.org>
Date:	Sat, 30 Jan 2016 05:20:52 -0800
From:	tip-bot for Alexander Kuleshov <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	ryabinin.a.a@...il.com, mingo@...nel.org, alpopov@...ecurity.com,
	linux-kernel@...r.kernel.org, luto@...nel.org, luto@...capital.net,
	brgerst@...il.com, bp@...en8.de, dvlasenk@...hat.com,
	peterz@...radead.org, kuleshovmail@...il.com,
	torvalds@...ux-foundation.org, tglx@...utronix.de, hpa@...or.com,
	bp@...e.de
Subject: [tip:x86/boot] x86/boot:
  Simplify kernel load address alignment check

Commit-ID:  a4733143085d6c782ac1e6c85778655b6bac1d4e
Gitweb:     http://git.kernel.org/tip/a4733143085d6c782ac1e6c85778655b6bac1d4e
Author:     Alexander Kuleshov <kuleshovmail@...il.com>
AuthorDate: Tue, 26 Jan 2016 22:12:10 +0100
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Sat, 30 Jan 2016 11:22:48 +0100

x86/boot: Simplify kernel load address alignment check

We are using %rax as temporary register to check the kernel
address alignment. We don't really have to since the TEST
instruction does not clobber the destination operand.

Suggested-by: Brian Gerst <brgerst@...il.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@...il.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: Alexander Popov <alpopov@...ecurity.com>
Cc: Andrey Ryabinin <ryabinin.a.a@...il.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/1453531828-19291-1-git-send-email-kuleshovmail@gmail.com
Link: http://lkml.kernel.org/r/1453842730-28463-11-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/head_64.S | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index ffdc0e8..7c21029 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -76,9 +76,7 @@ startup_64:
 	subq	$_text - __START_KERNEL_map, %rbp
 
 	/* Is the address not 2M aligned? */
-	movq	%rbp, %rax
-	andl	$~PMD_PAGE_MASK, %eax
-	testl	%eax, %eax
+	testl	$~PMD_PAGE_MASK, %ebp
 	jnz	bad_address
 
 	/*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ