From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754175AbeAKGYi (ORCPT + 1 other); Thu, 11 Jan 2018 01:24:38 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:39533 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbeAKGYh (ORCPT ); Thu, 11 Jan 2018 01:24:37 -0500 Date: Thu, 11 Jan 2018 07:23:59 +0100 From: Willy Tarreau To: "Woodhouse, David" Cc: "torvalds@linux-foundation.org" , "luto@kernel.org" , "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "peterz@infradead.org" , "keescook@chromium.org" , "tglx@linutronix.de" , "dave.hansen@linux.intel.com" , "jpoimboe@redhat.com" , "x86@kernel.org" , "hpa@zytor.com" , "brgerst@gmail.com" , "bp@alien8.de" Subject: Re: [RFC PATCH v3 6/8] x86/pti: don't mark the user PGD with _PAGE_NX. Message-ID: <20180111062358.GA14920@1wt.eu> References: <1515612500-14505-1-git-send-email-w@1wt.eu> <1515612500-14505-7-git-send-email-w@1wt.eu> <1515616106.22302.237.camel@amazon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515616106.22302.237.camel@amazon.co.uk> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi David, On Wed, Jan 10, 2018 at 08:28:27PM +0000, Woodhouse, David wrote: > So... we'd really like to *not* lose the property that KPTI implies > SMEP-like NX of user space for the kernel. Don't worry, I find it nice as well and am not trying to kill it. As mentionned in the "Note" section in the commit message, the current #ifdef is temporary to make the whole thing work and I'm seeking good ideas to do it only on unprotected processes. Andy proposed to continue to do it inconditionally and to catch the page fault upon the first return to user space and disable it. I like this approach but for now I don't know how to do it. Another possibility would be that we disable it when removing the protection on the mm. Given that most of the discussion till now has been focused on how to enable/disable the protection I'm leaving this part as-is for now. I'll change the temporary commit message to make it clearer that it's broken for now. Cheers, Willy