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:   Wed, 10 Jan 2018 12:00:24 +0000
From:   David Woodhouse <dwmw@...zon.co.uk>
To:     Andi Kleen <ak@...ux.intel.com>
Cc:     Paul Turner <pjt@...gle.com>, LKML <linux-kernel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...ux-foundation.org>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        Dave Hansen <dave.hansen@...el.com>, tglx@...utronix.de,
        Kees Cook <keescook@...gle.com>,
        Rik van Riel <riel@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andy Lutomirski <luto@...capital.net>,
        Jiri Kosina <jikos@...nel.org>, gnomes@...rguk.ukuu.org.uk,
        x86@...nel.org, bp@...en8.de, rga@...zon.de
Subject: [PATCH] x86/retpoline: Remove alignment directives from retpoline core

Now that the retpoline is emitted in the altinstr section, there's not a
lot of point in attempting to align it. It might be aligned there, but it
could still end up misaligned when copied into place over oldinstr.

It is also actively harmful, because the alternatives code will helpfully
spot that the first instruction of the alternative is a NOP and thus turn
*all* the rest of it into NOPs too. (A fix for which is already available,
but we just don't need to do it, so stop.)

Signed-off-by: David Woodhouse <dwmw@...zon.co.uk>
---
 arch/x86/include/asm/nospec-branch.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 6bda2c0..16329f1 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -15,12 +15,10 @@
  * invocation below less ugly.
  */
 .macro RETPOLINE_JMP reg:req
-	.align	16
 	call	.Ldo_rop_\@
 .Lspec_trap_\@:
 	pause
 	jmp	.Lspec_trap_\@
-	.align	16
 .Ldo_rop_\@:
 	mov	\reg, (%_ASM_SP)
 	ret
@@ -34,7 +32,6 @@
 	jmp	.Ldo_call_\@
 .Ldo_retpoline_jmp_\@:
 	RETPOLINE_JMP \reg
-	.align	16
 .Ldo_call_\@:
 	call	.Ldo_retpoline_jmp_\@
 .endm
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ