Return-Path: =?utf-8?q?=3CBATV+1518e722e709e2546b9d+5399+infradead=2Eorg+d?= =?utf-8?q?wmw2=40twosheds=2Esrs=2Einfradead=2Eorg=3E?= 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+1518e722e709e2546b9d+5399+infradea?= =?utf-8?q?d=2Eorg+dwmw2=40twosheds=2Esrs=2Einfradead=2Eorg=3E=29?= id 1fQGx5-00015Q-BF for speck@linutronix.de; Tue, 05 Jun 2018 20:45:04 +0200 Received: from [2001:8b0:10b:1::2fb] by twosheds.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQGx3-0006RC-Nd for speck@linutronix.de; Tue, 05 Jun 2018 18:45:01 +0000 Message-ID: <1528224300.24870.40.camel@infradead.org> Subject: [MODERATED] Re: ARCH_CAPABILITIES note From: David Woodhouse In-Reply-To: <0eca849b-fd6b-e42f-6c83-3c930d644bba@redhat.com> References: <0eca849b-fd6b-e42f-6c83-3c930d644bba@redhat.com> Date: Tue, 05 Jun 2018 19:45:00 +0100 Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Tue, 2018-06-05 at 12:41 -0400, speck for Jon Masters wrote: > Hi all, > > I've pinged Intel asking them to clarify ARCH_CAPABILITIES to ensure > that we don't open up exposure in future silicon to past exploits. > > One topic I can't touch on here, but another is the SSBD. So for v4, > we're currently (probably) safe (enough?) against kernel stack exploit > by virtue of the serializing lfence in the retpoline entry code. BUT if > future silicon says "hey, I'm fine" and we disable the retpoline > mitigation, we'll /still/ need to do the lfence on kernel entry. > > There are similar others where we just need to be /really/ careful. I'm also concerned about the backward compatibility of SPEC_CTRL. If a VM host exposes IBRS+STIPB to guests today by trapping the first access and then making it passthrough, and (rightly) faults on any other bits being set, then subsequent writes by the guest (when it's no longer trapped) will let those other bits be set. We already have this with the SSBD bit on pre-4.17 kernels. Although in 4.17 I note we actually let the guest set the SSBD bit on the first access without faulting, even when it's not supposed to be present in the guest (and in fact even on microcode where it *isn't* present at all). We could do with a mask of which bits the guest is allowed to set (and perhaps for future SPEC_CTRL bits, a different mask of which bits the guest is allowed to *clear*, to ensure the hypervisor remains protected?)