From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757323AbeAINLM (ORCPT + 1 other); Tue, 9 Jan 2018 08:11:12 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:33089 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757155AbeAINLJ (ORCPT ); Tue, 9 Jan 2018 08:11:09 -0500 Date: Tue, 9 Jan 2018 14:10:59 +0100 From: Peter Zijlstra To: David Woodhouse Cc: Andy Lutomirski , Andrew Cooper , Linus Torvalds , Andi Kleen , "linux-kernel@vger.kernel.org" , "tim.c.chen@linux.intel.com" , "tglx@linutronix.de" , "riel@redhat.com" , "keescook@google.com" , "gnomes@lxorguk.ukuu.org.uk" , "pjt@google.com" , "dave.hansen@intel.com" , "jikos@kernel.org" , "gregkh@linux-foundation.org" Subject: Re: [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch Message-ID: <20180109131059.GI6176@hirez.programming.kicks-ass.net> References: <1515363085-4219-1-git-send-email-dwmw@amazon.co.uk> <1515455051.15588.7.camel@infradead.org> <1515455902.4423.59.camel@amazon.co.uk> <20180109004415.GG6718@tassilo.jf.intel.com> <3aadb8a0-08c8-bdf9-7b91-0fa774a9e1ab@citrix.com> <1515503060.22302.19.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1515503060.22302.19.camel@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 09, 2018 at 01:04:20PM +0000, David Woodhouse wrote: > On Mon, 2018-01-08 at 19:27 -0800, Andy Lutomirski wrote: > > >  > > > If SMEP is not active, speculation can go anywhere, including to a user > > > controlled gadget which can reload any registers it needs, including > > > with immediate constants. > > > > I thought that, even on pre-SMEP hardware, the CPU wouldn't > > speculatively execute from NX pages.  And PTI marks user memory NX > > in kernel mode. > > Hm, now that could be useful.  > > Do *all* the KPTI backports (some of which are reimplementations rather > than strictly backports) mark user memory NX? That doesn't really matter for upstream though; but see here: https://lkml.kernel.org/r/1515502580-12261-5-git-send-email-w@1wt.eu