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]
Message-ID: <20180127135859.GA25291@localhost.localdomain>
Date:   Sat, 27 Jan 2018 08:59:02 -0500
From:   Konrad Rzeszutek Wilk <konrad@...nok.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Dave Hansen <dave.hansen@...el.com>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andy Lutomirski <luto@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Arjan Van De Ven <arjan.van.de.ven@...el.com>,
        David Woodhouse <dwmw@...zon.co.uk>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/8] x86/spec_ctrl: Add sysctl knobs to enable/disable
 SPEC_CTRL feature

On Mon, Jan 08, 2018 at 05:14:37PM +0100, Peter Zijlstra wrote:
> On Mon, Jan 08, 2018 at 01:47:07PM +0100, Peter Zijlstra wrote:
> > > a good suggestion, but we encountered some issues with it either
> > > crashing the kernel at boot or not properly turning on/off.
> 
> The below boots, but I lack stuff to test the enabling.

..snip..
> --- a/arch/x86/entry/calling.h
> +++ b/arch/x86/entry/calling.h
> @@ -373,22 +373,17 @@ For 32-bit we have the following convent
>  .endm
>  
>  .macro ENABLE_IBRS
> -	testl	$1, dynamic_ibrs
> -	jz	.Lskip_\@
> +	STATIC_JUMP_IF_FALSE .Lskip_\@, ibrs_key, def=0
>  
>  	PUSH_MSR_REGS
>  	WRMSR_ASM $MSR_IA32_SPEC_CTRL, $SPEC_CTRL_FEATURE_ENABLE_IBRS
>  	POP_MSR_REGS
> -	jmp	.Ldone_\@
>  
>  .Lskip_\@:
> -	lfence
> -.Ldone_\@:
>  .endm

I know that this particular patchset is now obsolete as the retpoline
along with stuffing the RSB half or full is the preferred way.

But I am wondering - why was the 'lfence' added in the first place
if dynamic_ibrs was zero?

It certainly is not putting the speculative execution on a wild ride
like: "[tip:x86/pti] x86/retpoline: Use LFENCE instead of PAUSE in the
retpoline/RSB filling RSB macros" https://git.kernel.org/tip/2eb9137c8744f9adf1670e9aa52850948a30112b

So what was the intent behind this? Was it: "oh if we do not have
IBRS let us at least add lfence on  every system call, interrupt, nmi,
exception, etc to do a poor man version of IBRS?"

Thank you.
P.S.
My apologies if this was discussed in the prior versions of this thread.
I must have missed it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ