linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	Dimitri John Ledkov <dimitri.ledkov@canonical.com>,
	Borislav Petkov <bp@suse.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH] x86/bugs: Do not enable IBPB at firmware entry when IBPB is not available
Date: Thu, 28 Jul 2022 17:16:40 +0200	[thread overview]
Message-ID: <YuKoWPRt56T+FE+s@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220728122602.2500509-1-cascardo@canonical.com>

On Thu, Jul 28, 2022 at 09:26:02AM -0300, Thadeu Lima de Souza Cascardo wrote:
> Some cloud hypervisors do not provide IBPB on very recent CPU processors,
> including AMD processors affected by Retbleed.

That's a bug in the hypervisor.

> Fixes: 28a99e95f55c ("x86/amd: Use IBPB for firmware calls")

Fixes^WCreates-a-speculation-hole-in:

> Reported-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: <stable@vger.kernel.org>
> ---
>  arch/x86/kernel/cpu/bugs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 6454bc767f0f..6761668100b9 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -1520,6 +1520,7 @@ static void __init spectre_v2_select_mitigation(void)
>  	 * enable IBRS around firmware calls.
>  	 */
>  	if (boot_cpu_has_bug(X86_BUG_RETBLEED) &&
> +	    boot_cpu_has(X86_FEATURE_IBPB) &&
>  	    (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
>  	     boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)) {

At the very least we need a pr_warn() and something nasty in
retbleed_show_state() to warn the user their firmware calls are
vulnerable.


  parent reply	other threads:[~2022-07-28 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 12:26 [PATCH] x86/bugs: Do not enable IBPB at firmware entry when IBPB is not available Thadeu Lima de Souza Cascardo
2022-07-28 12:35 ` Borislav Petkov
2022-07-28 12:39   ` Thadeu Lima de Souza Cascardo
2022-07-28 14:33   ` Dimitri John Ledkov
2022-07-28 15:18     ` Borislav Petkov
2022-07-28 15:50       ` Borislav Petkov
2022-07-28 17:01         ` Thadeu Lima de Souza Cascardo
2022-07-29 18:22           ` Borislav Petkov
2022-07-28 15:16 ` Peter Zijlstra [this message]
2022-07-29  8:11 ` [tip: x86/urgent] " tip-bot2 for Thadeu Lima de Souza Cascardo

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=YuKoWPRt56T+FE+s@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@suse.de \
    --cc=cascardo@canonical.com \
    --cc=dimitri.ledkov@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).