From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mga02.intel.com ([134.134.136.20]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fBPW5-0007GC-PR for speck@linutronix.de; Wed, 25 Apr 2018 20:51:46 +0200 Date: Wed, 25 Apr 2018 11:51:40 -0700 From: Andi Kleen Subject: [MODERATED] Re: [PATCH 1/6] Patch 1 Message-ID: <20180425185140.GL14273@tassilo.jf.intel.com> References: <20180425032932.31562-1-andi@firstfloor.org> <20180425160654.GH14273@tassilo.jf.intel.com> <20180425173619.GJ14273@tassilo.jf.intel.com> <20180425181152.GK14273@tassilo.jf.intel.com> MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: > - in a virtual environment, the host simply needs to flush its caches > before entering vmx mode, and now there is nothing sensitive for the > guest to access. All it can read is its own caches. This doesn't help unfortunately because it could also leak data inside the guest. If skipping EPT causes the PA to point to some other page inside the same guest you can leak that data. And that other page might be owned by the kernel or by some other process. If a guest uses most memory in the system that's quite likely. There was also another case, brought up by Google ChromeOS, where they control/trust the guest kernel and want to rely on it from accessing data outside the current guest, so not needing flush mitigations in the VMM. That one is a bit more dubious, but I guess it's also not completely broken. > Now, that said, we can have other things we can do to just make it harder > to mis-use this. In particular, we could fairly easily say: > > - PROT_NONE on a shared mapping means that we just flush and unmap all > the pages *entirely* (we leave the vma alone, and just rely on faulting > them back in after you set it back to something that isn't PROT_NONE) It doesn't need to be a shared mapping, can happen with any mapping. > > (And yes, I might be missing some detail, but I _really_ hate that > "special bit" patch. It fundamentally should not be needed). I don't think anyone likes it, we just couldn't find better solutions. -Andi