Return-path: Received: from mx2.suse.de ([195.135.220.15]) by Galois.linutronix.de with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fDtnY-0005Qy-DO for speck@linutronix.de; Wed, 02 May 2018 17:36:05 +0200 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D376AAEFA for ; Wed, 2 May 2018 15:35:54 +0000 (UTC) Date: Wed, 2 May 2018 17:35:54 +0200 From: Michal Hocko Subject: [MODERATED] Re: Updated L1TF native OS patch Message-ID: <20180502153554.GK26305@dhcp22.suse.cz> References: <20180501234247.GA41910@tassilo.jf.intel.com> <20180502000512.GO75137@tassilo.jf.intel.com> <20180502012112.GQ75137@tassilo.jf.intel.com> <20180502121420.GB31258@dhcp22.suse.cz> <20180502150739.GS75137@tassilo.jf.intel.com> MIME-Version: 1.0 In-Reply-To: <20180502150739.GS75137@tassilo.jf.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: 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