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]
Date: Fri, 9 Feb 2024 13:15:15 -0800
From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Josh Poimboeuf <jpoimboe@...nel.org>,
	Andy Lutomirski <luto@...nel.org>, Jonathan Corbet <corbet@....net>,
	Sean Christopherson <seanjc@...gle.com>,
	Paolo Bonzini <pbonzini@...hat.com>, tony.luck@...el.com,
	ak@...ux.intel.com, tim.c.chen@...ux.intel.com,
	Andrew Cooper <andrew.cooper3@...rix.com>,
	Nikolay Borisov <nik.borisov@...e.com>,
	linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
	kvm@...r.kernel.org,
	Alyssa Milburn <alyssa.milburn@...ux.intel.com>,
	Daniel Sneddon <daniel.sneddon@...ux.intel.com>,
	antonio.gomez.iglesias@...ux.intel.com,
	Alyssa Milburn <alyssa.milburn@...el.com>, stable@...nel.org
Subject: Re: [PATCH  v7 1/6] x86/bugs: Add asm helpers for executing VERW

On Fri, Feb 09, 2024 at 08:57:04PM +0100, Borislav Petkov wrote:
> On Fri, Feb 09, 2024 at 11:06:02AM -0800, Pawan Gupta wrote:
> > (Though, there was a comment on avoiding the macro alltogether, to which
> > I replied that it complicates 32-bit.)
> 
> Hmm, so this seems to build the respective entry_{32,64}.S TUs fine:
> 
> ---
> diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
> index e81cabcb758f..7d1e5fe66495 100644
> --- a/arch/x86/include/asm/nospec-branch.h
> +++ b/arch/x86/include/asm/nospec-branch.h
> @@ -313,12 +313,9 @@
>   *
>   * Note: Only the memory operand variant of VERW clears the CPU buffers.
>   */
> -.macro EXEC_VERW
> -	verw _ASM_RIP(mds_verw_sel)
> -.endm
>  
>  .macro CLEAR_CPU_BUFFERS
> -	ALTERNATIVE "", __stringify(EXEC_VERW), X86_FEATURE_CLEAR_CPU_BUF
> +	ALTERNATIVE "",  __stringify(verw _ASM_RIP(mds_verw_sel)), X86_FEATURE_CLEAR_CPU_BUF
>  .endm

> +.macro CLEAR_CPU_BUFFERS
> +     ALTERNATIVE "", __stringify(EXEC_VERW), X86_FEATURE_CLEAR_CPU_BUF
> +.endm

This works, thanks.

My mistake that I tried your earlier suggestion without playing with it:

  > > +.macro CLEAR_CPU_BUFFERS
  > > +   ALTERNATIVE "", __stringify(EXEC_VERW), X86_FEATURE_CLEAR_CPU_BUF
  > > +.endm
  >
  > Why can't this simply be:
  >
  > .macro CLEAR_CPU_BUFFERS
  >         ALTERNATIVE "", "verw mds_verw_sel(%rip)", X86_FEATURE_CLEAR_CPU_BUF
  > .endm
  >
  > without that silly EXEC_VERW macro?
  >
  > --
  > Regards/Gruss,
  >     Boris.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ