public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>, X86 ML <x86@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] [RFC] x86: work around MPX Erratum
Date: Thu, 5 May 2016 20:40:52 +0200	[thread overview]
Message-ID: <20160505184052.GA6110@gmail.com> (raw)
In-Reply-To: <CALCETrV46=nj+ZqW_c4GgUhyykypBRznDqUyngRceXEUPJMBoA@mail.gmail.com>


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Tue, May 3, 2016 at 11:44 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Andy Lutomirski <luto@amacapital.net> wrote:
> >
> >> On Tue, May 3, 2016 at 2:43 PM, Dave Hansen <dave.hansen@intel.com> wrote:
> >> > On 05/03/2016 02:31 PM, Andy Lutomirski wrote:
> >> >> Having actually read the erratum: how can this affect Linux at all
> >> >> under any scenario where user code hasn't already completely
> >> >> compromised the kernel?
> >> >>
> >> >> I.e. why do we care about this erratum?
> >> >
> >> > First of all, with SMEP, it doesn't affect us.  At all.
> >> >
> >> > Without SMEP, there would have to be a page accessible to userspace that the
> >> > kernel executes instructions from.  The only thing that I can think of that's
> >> > normally user-accessible and not _controlled_ by userspace is the VDSO.  But
> >> > the kernel never actually executes from it, so it doesn't matter here.
> >> >
> >> > I've heard reports of (but no actual cases in the wild of) folks remapping
> >> > kernel text to be user-accessible so that userspace can execute it, or of
> >> > having the kernel jump into user-provided libraries. Those are both obviously
> >> > bonkers and would only be done with out-of-tree gunk, but even if somebody did
> >> > that, they would be safe from the erratum, with this workaround.
> >>
> >> I'm not convinced this is worth adding any code for, though.  If someone adds
> >> out of tree crap that does this and manually turns off SMEP, I think they should
> >> get to keep both pieces.  Frankly, I think I'd *prefer* if the kernel crashed
> >> when calling user addresses like that just to discourage it.
> >
> > So the thing is, this doesn't have to be any (or much) code per se: my suggestion
> > was to make MPX depend on SMEP on the Kconfig level, so that it's not possible to
> > build MPX without having SMEP.
> 
> I don't think I understand that suggestion.  How can Kconfig protect against:
> 
> qemu -cpu host,-smep
> 
> ?

Right, it cannot - but I think the latest patch was pretty close and pretty 
simple.

Thanks,

	Ingo

  reply	other threads:[~2016-05-05 18:40 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
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 [this message]
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=20160505184052.GA6110@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --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