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]
Date:   Thu, 11 Jan 2018 00:04:34 +0000
From:   "Woodhouse, David" <dwmw@...zon.co.uk>
To:     Tim Chen <tim.c.chen@...ux.intel.com>,
        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>,
        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: Re: [PATCH] x86/retpoline: Fill return stack buffer on vmexit

On Wed, 2018-01-10 at 15:47 -0800, Tim Chen wrote:
> 
> > +
> > +     asm volatile (ALTERNATIVE("",
> > +                               __stringify(__FILL_RETURN_BUFFER(%0, %1, _%=)),
> > +                               X86_FEATURE_RETPOLINE)
> 
> We'll be patching in a fairly long set of instructions here.  Maybe put
> the ALTERNATIVE in the assembly and use a jmp skip_\@ for the ALTERNATIVE.

Perhaps the alternatives.h header could give me a clean way of doing this:

--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -177,7 +178,7 @@ static inline void vmexit_fill_RSB(void)
 {
        unsigned long dummy;
 
-       asm volatile (ALTERNATIVE("",
+       asm volatile (ALTERNATIVE("jmp " alt_end_marker "f",
                                  __stringify(__FILL_RETURN_BUFFER(%0, %1, _%=)),
                                  X86_FEATURE_RETPOLINE)
                      : "=r" (dummy), ASM_CALL_CONSTRAINT : : "memory" );
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5210 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ