public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Jane Malalane <jane.malalane@citrix.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Borislav Petkov <bp@suse.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH for 4.19] x86/cpu: Fix migration safety with X86_BUG_NULL_SEL
Date: Mon, 15 Nov 2021 18:03:39 +0100	[thread overview]
Message-ID: <YZKS63HXBGrcMj10@kroah.com> (raw)
In-Reply-To: <20211115163020.16672-1-jane.malalane@citrix.com>

On Mon, Nov 15, 2021 at 04:30:20PM +0000, Jane Malalane wrote:
> commit 415de44076640483648d6c0f6d645a9ee61328ad upstream.
> 
> Currently, Linux probes for X86_BUG_NULL_SEL unconditionally which
> makes it unsafe to migrate in a virtualised environment as the
> properties across the migration pool might differ.
> 
> To be specific, the case which goes wrong is:
> 
> 1. Zen1 (or earlier) and Zen2 (or later) in a migration pool
> 2. Linux boots on Zen2, probes and finds the absence of X86_BUG_NULL_SEL
> 3. Linux is then migrated to Zen1
> 
> Linux is now running on a X86_BUG_NULL_SEL-impacted CPU while believing
> that the bug is fixed.
> 
> The only way to address the problem is to fully trust the "no longer
> affected" CPUID bit when virtualised, because in the above case it would
> be clear deliberately to indicate the fact "you might migrate to
> somewhere which has this behaviour".
> 
> Zen3 adds the NullSelectorClearsBase CPUID bit to indicate that loading
> a NULL segment selector zeroes the base and limit fields, as well as
> just attributes. Zen2 also has this behaviour but doesn't have the NSCB
> bit.
> 
>  [ bp: Minor touchups. ]
> 
> Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> CC: <stable@vger.kernel.org>
> Link: https://lkml.kernel.org/r/20211021104744.24126-1-jane.malalane@citrix.com
> ---
> Backport to 4.19.  Drop Hygon modifications.

Now queued up, thanks.

greg k-h

      reply	other threads:[~2021-11-15 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 16:30 [PATCH for 4.19] x86/cpu: Fix migration safety with X86_BUG_NULL_SEL Jane Malalane
2021-11-15 17:03 ` Greg KH [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=YZKS63HXBGrcMj10@kroah.com \
    --to=greg@kroah.com \
    --cc=bp@suse.de \
    --cc=jane.malalane@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.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