Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965616AbbLRVDO (ORCPT ); Fri, 18 Dec 2015 16:03:14 -0500 Received: from mail-oi0-f51.google.com ([209.85.218.51]:34255 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965006AbbLRVDL (ORCPT ); Fri, 18 Dec 2015 16:03:11 -0500 MIME-Version: 1.0 In-Reply-To: <56747360.3040909@zytor.com> 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> From: Andy Lutomirski Date: Fri, 18 Dec 2015 13:02:50 -0800 Message-ID: Subject: Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? To: "H. Peter Anvin" Cc: Linus Torvalds , Dave Hansen , Oleg Nesterov , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Brian Gerst , "linux-kernel@vger.kernel.org" , Christoph Hellwig Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1223 Lines: 29 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. These bits would be read and written by prctl, but there could also be an ELF note mechanism to initialize them on execve without a syscall. --Andy -- 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/