Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fC9YK-0007zX-8Y for speck@linutronix.de; Fri, 27 Apr 2018 22:01:08 +0200 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5721AFB67C for ; Fri, 27 Apr 2018 20:01:02 +0000 (UTC) Received: from washington.bos.jonmasters.org (ovpn-121-188.rdu2.redhat.com [10.10.121.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3DD4F215CDCB for ; Fri, 27 Apr 2018 20:01:02 +0000 (UTC) Subject: [MODERATED] Re: [PATCH v2] Linux Patch 1/1 References: <92c45587-5eb3-2421-6fc1-42e74a715e30@linux.intel.com> <20180427164743.GA14180@pd.tnic> <6e2b14fc-3bf6-071d-6ce2-e518f2c4f069@redhat.com> <20180427173221.GB14180@pd.tnic> <20180427180944.GD75137@tassilo.jf.intel.com> <2de93c45-9bcc-136d-3534-03d05bd6b660@redhat.com> From: Jon Masters Message-ID: <860007dc-9f34-3b02-19e7-34dd7ce68dec@redhat.com> Date: Fri, 27 Apr 2018 16:01:01 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="1FfuL6NmPAs3oKMrxMDzEmrb8oTp7Ay2T"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --1FfuL6NmPAs3oKMrxMDzEmrb8oTp7Ay2T Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04/27/2018 03:52 PM, speck for Linus Torvalds wrote: >=20 >=20 > On Fri, 27 Apr 2018, speck for Jon Masters wrote: >> >> It /might/ be an issue for the kernel stack. This is the fear many of = us >> have. >=20 > Honestly, the kernel stack worry would be the *reverse* of the store=20 > buffer bypass. Kinda, but also on entry we save untrusted user-provided register values on the stack. If those are updated and then used (or also happens with uninitialized stack values), then it's possible that the older untrusted content is used. It's a very unlikely attack since we also do an lfence as part of the indirect retpolined function calls on entry, but once we dispatch to the syscall handler functions themselves, this very theoretical case is vaguely possible. > So it's kernel exit I'd worry about, where a kernel store that is (stil= l)=20 > in the store buffers can be incorrectly seen by user space because the = > store buffer load forwarding doesn't do any permission checking at all.= >=20 > I'm assuming nobody has _that_ bug. But it might be worth asking around= =2E They do and this is still a problem. Not just on x86. POWER are adding a new "stf-flush" instruction to every entry/exit path for this reason. They're ready with those patches - obviously they're not on this list, but they know they can ping you with them. Jon. --=20 Computer Architect | Sent from my Fedora powered laptop --1FfuL6NmPAs3oKMrxMDzEmrb8oTp7Ay2T--