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: <20240209195704.GEZcaDkMUR560qafaI@fat_crate.local>
Date: Fri, 9 Feb 2024 20:57:04 +0100
From: Borislav Petkov <bp@...en8.de>
To: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
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 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
 
 #else /* __ASSEMBLY__ */
---

and looking at the asm:

64-bit:

# 317 "./arch/x86/include/asm/nospec-branch.h"
macro CLEAR_CPU_BUFFERS
 ALTERNATIVE "", "verw mds_verw_sel (% rip)", ( 3*32+18)
endm

  23:   0f 00 2d 00 00 00 00    verw   0x0(%rip)        # 2a <.altinstr_replacement+0x2a>

32-bit:

macro CLEAR_CPU_BUFFERS
 ALTERNATIVE "", "verw mds_verw_sel", ( 3*32+18)
endm

 13d:   0f 00 2d 00 00 00 00    verw   0x0

it makes sense.

So what complications do you mean?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ