Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965633AbbLRVIQ (ORCPT ); Fri, 18 Dec 2015 16:08:16 -0500 Received: from mga14.intel.com ([192.55.52.115]:45801 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965178AbbLRVIM (ORCPT ); Fri, 18 Dec 2015 16:08:12 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,447,1444719600"; d="scan'208";a="844298743" Subject: Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? To: Andy Lutomirski , "H. Peter Anvin" References: <56736BD1.5080700@linux.intel.com> <5673750B.606@linux.intel.com> <567453AF.5060808@linux.intel.com> <56746774.8000707@linux.intel.com> <56747360.3040909@zytor.com> Cc: Linus Torvalds , Oleg Nesterov , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Brian Gerst , "linux-kernel@vger.kernel.org" , Christoph Hellwig From: Dave Hansen Message-ID: <567475B8.8020800@linux.intel.com> Date: Fri, 18 Dec 2015 13:08:08 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1457 Lines: 29 On 12/18/2015 01:02 PM, Andy Lutomirski wrote: > On Fri, Dec 18, 2015 at 12:58 PM, H. Peter Anvin wrote: >> > On 12/18/2015 12:49 PM, Andy Lutomirski wrote: >>> >> >>> >> IOW, I like my idea in which signal delivery always sets PKRU to the >>> >> application-requested-by-syscall values and sigreturn restores it. >>> >> Kinda like sigaltstack, but applies to all signals and affects PKRU >>> >> instead of RSP. >>> >> >> > I think this is the only sensible option, with the default being all zero. >> > > Or not quite all zero if we do Dave's experimental PROT_EXEC thing. > > Actually, I want to introduce a set of per-mm "incompatible" bits. By > default, they'd be zero. We can, as needed, define bits that do > something nice but break old code. I want one of the bits to turn > vsyscalls off entirely. Another bit could say that the kernel is > allowed to steal a protection key for PROT_EXEC. That really only makes sense if we have userspace that expects all the protection keys to be available. If we go the route of having pkey_alloc/free() syscalls, then the kernel can easily tell userspace to keep its mitts off a particular pkey by not ever returning it from a pkey_alloc(). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/