From: Josh Poimboeuf <jpoimboe@kernel.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Daniel Sneddon <daniel.sneddon@linux.intel.com>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Alexandre Chartre <alexandre.chartre@oracle.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Peter Zijlstra <peterz@infradead.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sean Christopherson <seanjc@google.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Nikolay Borisov <nik.borisov@suse.com>,
KP Singh <kpsingh@kernel.org>, Waiman Long <longman@redhat.com>,
Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH 3/3] x86/bugs: Remove support for Spectre v2 LFENCE "retpolines"
Date: Fri, 12 Apr 2024 21:21:35 -0700 [thread overview]
Message-ID: <20240413042135.z2vglouqfl763m77@treble> (raw)
In-Reply-To: <e5356c0e018cd0a96aabe719f685c237ac519403.1712944776.git.jpoimboe@kernel.org>
On Fri, Apr 12, 2024 at 11:10:34AM -0700, Josh Poimboeuf wrote:
> I found several bugs where code assumes that X86_FEATURE_RETPOLINE
> actually means retpolines (imagine that!). In fact that feature also
> includes the original AMD LFENCE "retpolines", which aren't in fact
> retpolines.
>
> Really, those "retpolines" should just be removed. They're already
> considered vulnerable due to the fact that the speculative window after
> the indirect branch can still be long enough to do multiple dependent
> loads. And recent tooling makes such gadgets easier to find.
>
> Also, EIBRS_LFENCE tests worse in real-world benchmarks than the actual
> BHI mitigations, so it's both slower and less secure.
>
> Specifically this removes support for the following cmdline options:
>
> - spectre_v2=retpoline,amd
> - spectre_v2=retpoline,lfence
> - spectre_v2=eibrs,lfence
>
> Now when any of those options are used, it will print an error and fall
> back to the defaults (spectre_v2=auto spectre_bhi=on).
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Compile fix:
diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h
index e1c421282a78..3a1349c0f225 100644
--- a/arch/x86/include/asm/disabled-features.h
+++ b/arch/x86/include/asm/disabled-features.h
@@ -53,7 +53,7 @@
#ifdef CONFIG_MITIGATION_RETPOLINE
# define DISABLE_RETPOLINE 0
#else
-# define DISABLE_RETPOLINE (1 << (X86_FEATURE_RETPOLINE & 31)
+# define DISABLE_RETPOLINE (1 << (X86_FEATURE_RETPOLINE & 31))
#endif
#ifdef CONFIG_MITIGATION_RETHUNK
prev parent reply other threads:[~2024-04-13 4:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 18:10 [PATCH 0/3] x86/bugs: BHI fixes / improvements - round 2 Josh Poimboeuf
2024-04-12 18:10 ` [PATCH v2 1/3] x86/bugs: Only harden syscalls when needed Josh Poimboeuf
2024-04-12 22:42 ` Pawan Gupta
2024-04-12 22:58 ` Josh Poimboeuf
2024-04-15 7:32 ` Nikolay Borisov
2024-04-15 15:16 ` Linus Torvalds
2024-04-15 15:27 ` Nikolay Borisov
2024-04-15 15:47 ` Linus Torvalds
2024-04-12 18:10 ` [PATCH 2/3] x86/bugs: Fix BHI retpoline check Josh Poimboeuf
2024-04-12 23:18 ` Pawan Gupta
2024-04-14 9:19 ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2024-04-12 18:10 ` [PATCH 3/3] x86/bugs: Remove support for Spectre v2 LFENCE "retpolines" Josh Poimboeuf
2024-04-12 18:20 ` Josh Poimboeuf
2024-04-12 20:49 ` Andrew Cooper
2024-04-15 23:44 ` Josh Poimboeuf
2024-04-13 4:21 ` Josh Poimboeuf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240413042135.z2vglouqfl763m77@treble \
--to=jpoimboe@kernel.org \
--cc=alexandre.chartre@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=daniel.sneddon@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=konrad.wilk@oracle.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=nik.borisov@suse.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®