Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 13 Aug 2018 19:28:05 -0000 Received: from mga01.intel.com ([192.55.52.88]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fpIVW-0004fr-R4 for speck@linutronix.de; Mon, 13 Aug 2018 21:28:03 +0200 Date: Mon, 13 Aug 2018 12:27:58 -0700 From: "Luck, Tony" Subject: [MODERATED] Re: Cache load gadgets Message-ID: <20180813192757.GA25361@agluck-desk> References: <1533736415.3615.64.camel@infradead.org> <20180808145316.GX4238@tassilo.jf.intel.com> <20180808153429.quokqzwwvnripsdj@treble> <20180813151727.GA15539@char.us.oracle.com> <1534178427.2538.64.camel@infradead.org> MIME-Version: 1.0 In-Reply-To: <1534178427.2538.64.camel@infradead.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon, Aug 13, 2018 at 06:40:27PM +0200, speck for David Woodhouse wrote: > Even the gadget fixes are a band-aid. As Josh says, there are hundreds > of them. It's not massively feasible to close every gap, if this is > what we consider the attack surface to be. > > I think we need to take a serious look at actually removing sensitive > pages from the physical 1:1 map so that they *can't* be accessed. > > Maybe start with a way for kernel code to request an "otherwise > unmapped" page, which would need to be explicitly mapped for each > access (after ensuring that no potentially malicious guest is running). > Or which could be mapped into a per-process address, in some cases > (like a VMCS for a given vCPU). Could we build on top of KPTI? I.e. on entry to the kernel we currently have nothing important mapped. If we added code to that to validate user input (i.e. the "front-end" to system calls). If out of range values are found then we have a fast -EINVAL back to the user. If everything is OK, then we do the KPTI switch to the full kernel address space. ioctl would be a pain, but most other system calls would just require refactoring into a front-end validity check and a back end that does the real work. -Tony