Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965244AbeALWBR (ORCPT + 1 other); Fri, 12 Jan 2018 17:01:17 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:39801 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965133AbeALWBQ (ORCPT ); Fri, 12 Jan 2018 17:01:16 -0500 Date: Fri, 12 Jan 2018 22:54:22 +0100 From: Willy Tarreau To: Andy Lutomirski Cc: Ingo Molnar , Linus Torvalds , Andy Lutomirski , Dave Hansen , Peter Zijlstra , LKML , X86 ML , Borislav Petkov , Brian Gerst , Thomas Gleixner , Josh Poimboeuf , "H. Peter Anvin" , Greg Kroah-Hartman , Kees Cook Subject: Re: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set Message-ID: <20180112215422.GB16470@1wt.eu> References: <20180111064259.GC14920@1wt.eu> <0f08d89e-61e1-20e3-5c59-0b2f7b32bf0c@linux.intel.com> <20180111154412.GA15296@1wt.eu> <20180111174025.GB15344@1wt.eu> <50EB5B67-E441-43A6-8DD7-650A75B6ABE7@amacapital.net> <20180112202238.hc2dkjvmu7wlz7xw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: On Fri, Jan 12, 2018 at 01:18:06PM -0800, Andy Lutomirski wrote: > FWIW, if we take this approach, then either dropping the capability should > turn PTI back on or we need to deal with the corner case of PTI off and > capability not present. The latter is a bit awkward but not necessarily a > show stopper. I think that all we need to do is to update the ptrace rules > and maybe make PTI turn back on when we execve. At least there's no need to > muck around with LSM hooks. That's my point as well, just the same principle as the "NEXT" prctl : only perform changes on execve(). At least we're sure to deal with something consistent and it's the right moment for deciding on _PAGE_NX. Willy