All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: Updated L1TF native OS patch
Date: Wed, 2 May 2018 17:35:54 +0200	[thread overview]
Message-ID: <20180502153554.GK26305@dhcp22.suse.cz> (raw)
In-Reply-To: <20180502150739.GS75137@tassilo.jf.intel.com>

On Wed 02-05-18 08:07:39, speck for Andi Kleen wrote:
> > I have to confess that I do not understand the thread model for
> > PROT_NONE patch though. The mitigation _has_ to be done on the
> > VM layer otherwise we are screwed. So why should we even bother
> > and make the code even more kludgy?
> 
> It has to be done in both layers. One is between guests/hosts,
> and the other is inside the guest.
> 
> Here's an example:
> 
> You have physical pages 1 2. They get mapped into a guest as 
> GPA 1 -> PA 2
> GPA 2 -> PA 1
> through EPT. 
> 
> The L1TF speculation ignores the EPT remapping.
> 
> Now the guest kernel maps GPA 1 to process A and GPA 2 to process B,
> and they belong to different users and should be isolated.
> 
> If A sets the GPA 1 PA 2 page to PROT_NONE to bypass the EPT remapping
> and gets read access to the underlying physical page. Which
> in this case points to PA 2, so it can read process B's data,
> if it happened to be in L1.
> 
> So we broke isolation inside the guest. 

OK, I see. Thanks for the clarification. I guess the changelog could be
more explicit about thits.

> There's nothing the hypervisor can do about this. This
> mitigation has to be done in the guest.
> 
> > Patch 3 seems reasonable but I do not feel confident enough to give my
> > ack because I simply have no idea whether some obscure HW depends on the
> > zero page.
> 
> Can you expand? How should hardware depend on it?
> 
> It certainly cannot write to it, and even reading would be dubious because
> the contents are undefined.

Yeah, reads is what I would be worried about. I do not have any specific
offender in mind but this is really hard to check for.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-05-02 15:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 23:42 [MODERATED] Updated L1TF native OS patch Andi Kleen
2018-05-01 23:59 ` [MODERATED] " Linus Torvalds
2018-05-02  0:05   ` Andi Kleen
2018-05-02  1:21     ` Andi Kleen
2018-05-02  8:04       ` Peter Zijlstra
2018-05-02 10:48       ` Thomas Gleixner
2018-05-02 12:04         ` Thomas Gleixner
2018-05-02 14:50         ` [MODERATED] " Andi Kleen
2018-05-02 14:53           ` Thomas Gleixner
2018-05-02 12:14       ` [MODERATED] " Michal Hocko
2018-05-02 12:36         ` Thomas Gleixner
2018-05-02 12:44           ` [MODERATED] " Michal Hocko
2018-05-02 15:07         ` Andi Kleen
2018-05-02 15:35           ` Michal Hocko [this message]
2018-05-02 16:08             ` Andi Kleen
2018-05-03  9:26               ` Michal Hocko
2018-05-03 10:04         ` Michal Hocko

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=20180502153554.GK26305@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=speck@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.