Return-Path: =?utf-8?q?=3CBATV+548dd5b08e86edcb207b+5468+infradead=2Eorg+d?= =?utf-8?q?wmw2=40twosheds=2Esrs=2Einfradead=2Eorg=3E?= Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 13 Aug 2018 16:41:26 -0000 Received: from twosheds.infradead.org ([2001:8b0:10b:1:21d:7dff:fe04:dbe2]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from =?utf-8?q?=3CBATV+548dd5b08e86edcb207b+5468+infradea?= =?utf-8?q?d=2Eorg+dwmw2=40twosheds=2Esrs=2Einfradead=2Eorg=3E=29?= id 1fpFtO-0001nd-1h for speck@linutronix.de; Mon, 13 Aug 2018 18:40:30 +0200 Received: from [54.239.6.185] (helo=uc8d3ff76b9bc5848a9cc.drs10.amazon.com) by twosheds.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fpFtL-001quK-Se for speck@linutronix.de; Mon, 13 Aug 2018 16:40:27 +0000 Message-ID: <1534178427.2538.64.camel@infradead.org> Subject: [MODERATED] Re: Cache load gadgets From: David Woodhouse In-Reply-To: <20180813151727.GA15539@char.us.oracle.com> References: <1533736415.3615.64.camel@infradead.org> <20180808145316.GX4238@tassilo.jf.intel.com> <20180808153429.quokqzwwvnripsdj@treble> <20180813151727.GA15539@char.us.oracle.com> Date: Mon, 13 Aug 2018 18:40:27 +0200 Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Mon, 2018-08-13 at 11:17 -0400, speck for Konrad Rzeszutek Wilk wrote: > On Wed, Aug 08, 2018 at 10:34:29AM -0500, speck for Josh Poimboeuf wrote: > >=20 > > On Wed, Aug 08, 2018 at 07:53:16AM -0700, speck for Andi Kleen wrote: > > >=20 > > > On Wed, Aug 08, 2018 at 02:53:35PM +0100, speck for David Woodhouse wro= te: > > > >=20 > > > > If we aren't disabling hyperthreading, then we get to lose sleep over > > > > what a VM guest can trick us into loading into L1$ while a sibling ru= ns > > > > the attack. > > > >=20 > > > > For this they only need half a Spectre-v1 gadget; they only need to > > > > load something into L1. We've tweaked our scanner and trawled through > > > > the false positives, and we have a handful of patches which look > > > > something like the one below. > > > >=20 > > > > Should we be getting these into the tree for next Tuesday's release? > > > I don't think it's absolutely needed for Tuesday, can go in slower. > > >=20 > > > There will be a range of enhancements for L1TF beyond Tuesday anyways. > > > > Yet this patch is trivial, no harm in merging it now.=C2=A0=C2=A0We alrea= dy have a > > similar one in RHEL (and several hundred more like it). > > Josh, and David,=C2=A0=C2=A0would it be possible to include me (konrad.wilk= @oracle.com), > jamie.iles@oracle.com, liran.alon@oracle.com on anything that is sent > after Tuesday? >=20 > As in we want to help in analyzing and reviewing them to minimize the > effect on the upstream kernel for this particular nasty attack and the > above folks aren't reading every LKML email :-).=C2=A0 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). We could look at doing something similar for anonymous user pages too, and poking those out of the 1:1 map =E2=80=94 at a cost of having to deal with get_user_pages() et al. It's distinctly non-trivial but it is potentially a way forward that gives us some confidence that an attacker *can't* just read arbitrary memory, pulled in via cache load gadgets or other means. If we're going to have certain pages accessible only when a malicious (or just different) guest can't be running on the sibling... perhaps we also end up wanting coscheduling.