mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Shah, Amit" <Amit.Shah@amd.com>
To: "jpoimboe@kernel.org" <jpoimboe@kernel.org>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"kai.huang@intel.com" <kai.huang@intel.com>,
	"boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"daniel.sneddon@linux.intel.com" <daniel.sneddon@linux.intel.com>,
	"pawan.kumar.gupta@linux.intel.com"
	<pawan.kumar.gupta@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"seanjc@google.com" <seanjc@google.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"Moger, Babu" <Babu.Moger@amd.com>,
	"Phillips, Kim" <kim.phillips@amd.com>,
	"Das1, Sandipan" <Sandipan.Das@amd.com>,
	"dwmw@amazon.co.uk" <dwmw@amazon.co.uk>,
	"amit@kernel.org" <amit@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"bp@alien8.de" <bp@alien8.de>,
	"Kaplan, David" <David.Kaplan@amd.com>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH 2/2] x86/bugs: Don't fill RSB on context switch with eIBRS
Date: Thu, 21 Nov 2024 13:28:18 +0000	[thread overview]
Message-ID: <a3242e93ab2b38fb3279af01472c14bcdf9766d8.camel@amd.com> (raw)
In-Reply-To: <20241120162120.z6zteeespf4cir4s@jpoimboe>

On Wed, 2024-11-20 at 08:21 -0800, jpoimboe@kernel.org wrote:
> On Wed, Nov 20, 2024 at 10:27:42AM +0000, Shah, Amit wrote:
> > On Tue, 2024-11-19 at 23:27 -0800, Josh Poimboeuf wrote:
> > > User->user Spectre v2 attacks (including RSB) across context
> > > switches
> > > are already mitigated by IBPB in cond_mitigation(), if enabled
> > > globally
> > > or if at least one of the tasks has opted in to protection.  RSB
> > > filling
> > > without IBPB serves no purpose for protecting user space, as
> > > indirect
> > > branches are still vulnerable.
> > > 
> > > User->kernel RSB attacks are mitigated by eIBRS.  In which case
> > > the
> > > RSB
> > > filling on context switch isn't needed.  Fix that.
> > > 
> > > While at it, update and coalesce the comments describing the
> > > various
> > > RSB
> > > mitigations.
> > 
> > Looks good from first impressions - but there's something that
> > needs
> > some deeper analysis: AMD's Automatic IBRS piggybacks on eIBRS, and
> > has
> > some special cases.  Adding Kim to CC to check and confirm if
> > everything's still as expected.
> 
> FWIW, so "Technical Guidance for Mitigating Branch Type Confusion"
> has
> the following:
> 
>   Finally, branches that are predicted as ‘ret’ instructions get
> their
>   predicted targets from the Return Address Predictor (RAP). AMD
>   recommends software use a RAP stuffing sequence (mitigation V2-3 in
>   [2]) and/or Supervisor Mode Execution Protection (SMEP) to ensure
> that
>   the addresses in the RAP are safe for speculation. Collectively, we
>   refer to these mitigations as “RAP Protection”.
> 
> So it sounds like user->kernel RAP poisoning is mitigated by SMEP on
> AMD.

It indeed is. I'm just asking Kim to confirm whether the AutoIBRS
workflow can be updated based on this rework -- esp with disabling it
for SEV-SNP hosts.  I just went through those patches, and it doesn't
look like anything needs changing.

		Amit




  reply	other threads:[~2024-11-21 13:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  7:27 [PATCH 0/2] x86/bugs: RSB tweaks Josh Poimboeuf
2024-11-20  7:27 ` [PATCH 1/2] x86/bugs: Don't fill RSB on VMEXIT with eIBRS+retpoline Josh Poimboeuf
2024-11-20 18:12   ` Pawan Gupta
2024-11-20  7:27 ` [PATCH 2/2] x86/bugs: Don't fill RSB on context switch with eIBRS Josh Poimboeuf
2024-11-20 10:27   ` Shah, Amit
2024-11-20 16:21     ` jpoimboe
2024-11-21 13:28       ` Shah, Amit [this message]
2024-11-20 15:24   ` Shah, Amit
2024-11-20 18:42   ` Pawan Gupta
2024-11-21 13:29 ` [PATCH 0/2] x86/bugs: RSB tweaks Shah, Amit

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=a3242e93ab2b38fb3279af01472c14bcdf9766d8.camel@amd.com \
    --to=amit.shah@amd.com \
    --cc=Babu.Moger@amd.com \
    --cc=David.Kaplan@amd.com \
    --cc=Sandipan.Das@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=amit@kernel.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dwmw@amazon.co.uk \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=kim.phillips@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --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®