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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1515627145.22302.273.camel@amazon.co.uk>
Date:   Wed, 10 Jan 2018 23:32:25 +0000
From:   "Woodhouse, David" <dwmw@...zon.co.uk>
To:     David Lang <david@...g.hm>
CC:     Andi Kleen <ak@...ux.intel.com>, 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: Re: [PATCH] x86/retpoline: Fill return stack buffer on vmexit

On Wed, 2018-01-10 at 15:22 -0800, David Lang wrote:
> I somewhat hate to ask this, but for those of us following at home, what does 
> this add to the overhead?
> 
> I am remembering an estimate from mid last week that put retpoline at replacing 
> a 3 clock 'ret' with 30 clocks of eye-bleed code

Retpoline doesn't replace 'ret'.

It replaces indirect branches (jmp *%rax) of which there aren't quite
as many in the kernel.

The eye-bleed retpoline thunk does actually stop speculation and cause
a pipeline stall. For the RSB stuffing that's not the case; there are
no barriers here.

The actual performance numbers depend on the precise CPU being used,
and I'm not sure anyone has done the microbenchmarks of each *specific*
part for of the mitigations separately. For this *particular* patch...
well, we strive to avoid vmexits anyway, and Intel has spent the last
decade adding more and more tricks to the CPU to help us *avoid*
vmexits. So a little extra overhead on the vmexit is something we can
probably tolerate.

FWIW the IBRS microcode also requires the RSB-stuffing, so it's kind of
orthogonal to the "retpoline is much faster than IBRS" observation.


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