public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Dave Hansen <dave@sr71.net>
Cc: linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com,
	x86@kernel.org, Andy Lutomirski <luto@kernel.org>,
	Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] [RFC] x86: work around MPX Erratum
Date: Tue, 3 May 2016 08:43:54 +0200	[thread overview]
Message-ID: <20160503064354.GA11112@gmail.com> (raw)
In-Reply-To: <20160502220341.9E8C34FC@viggo.jf.intel.com>


* Dave Hansen <dave@sr71.net> wrote:

> 
> From: Dave Hansen <dave.hansen@linux.intel.com>
> 
> Big core processors (Xeon/Core) are affected by an MPX erratum.
> This erratum can only be triggered when a system is not using
> Supervisor Mode Execution Prevention (SMEP).  To work around
> this, we ensure that MPX can only be used in cases where SMEP is
> present in the processor and enabled.

That's fair enough IMHO.

> MPX and SMEP are present together in the *vast* majority of
> cases, and the kernel does not generally execute code that is
> readable by userspace, so the real-world impact of this issue is
> expected to be very limited.
> 
> Note that we don't have a good way to tell if we are on an
> unaffected Atom processor or an affected Core/Xeon.  The
> solution for the moment is to just be conservative and assume
> that everything is affected unless explicitly known to be
> unaffected.

> +static int is_mpx_affected_microarch(struct cpuinfo_x86 *c)
> +{
> +	/* Only family 6 is affected */
> +	if (c->x86 != 0x6)
> +		return 0;
> +
> +	/* We know these Atom models are unaffected, for sure */
> +	switch (c->x86_model) {
> +	case 0x5F: /* "Future Intel Atom ... Goldmont */
> +	case 0x5C: /* "Future Intel Atom ... Goldmont */
> +	     return 0;
> +	}
> +	/*
> +	 * We will get here on future unknown processors and all
> +	 * Core/Xeons.  They might be unaffected Atoms or
> +	 * affected Core/Xeons. Be conservative and assume
> +	 * processor is affected.
> +	 *
> +	 * Once the complete list of Core/Xeon models is known
> +	 * it can be added here, and the Atom list removed.
> +	 */
> +	return 1;

So instead of trying to sort out the erratum, could we not just generally make MPX 
dependent on SMEP and be done with it? MPX is a sophisticated security feature, 
and it makes little sense to not do SMEP if you have it available.

Anyone who is absolutely desperate to disable SMEP while enabling MPX is free to 
step in and make his case.

I.e. I think the simplest workaround would be to disable MPX if SMEP is disabled.

Thanks,

	Ingo

  reply	other threads:[~2016-05-03  6:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 22:03 [PATCH] [RFC] x86: work around MPX Erratum Dave Hansen
2016-05-03  6:43 ` Ingo Molnar [this message]
2016-05-03 21:04   ` Dave Hansen
2016-05-03 21:12     ` Borislav Petkov
2016-05-03 21:28       ` Dave Hansen
2016-05-03 21:33         ` Linus Torvalds
2016-05-03 21:45         ` Borislav Petkov
2016-05-03 21:31     ` Andy Lutomirski
2016-05-03 21:39       ` Linus Torvalds
2016-05-03 21:44         ` Andy Lutomirski
2016-05-03 21:43       ` Dave Hansen
2016-05-03 21:53         ` Andy Lutomirski
2016-05-04  6:44           ` Ingo Molnar
2016-05-05 17:14             ` Andy Lutomirski
2016-05-05 18:40               ` Ingo Molnar
2016-05-06 19:01                 ` Andy Lutomirski

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=20160503064354.GA11112@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave@sr71.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --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