From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by kanga.kvack.org (Postfix) with ESMTP id E6A046B0254 for ; Mon, 14 Dec 2015 19:26:45 -0500 (EST) Received: by pacdm15 with SMTP id dm15so112140575pac.3 for ; Mon, 14 Dec 2015 16:26:45 -0800 (PST) Received: from blackbird.sr71.net (www.sr71.net. [198.145.64.142]) by mx.google.com with ESMTP id pz7si14464643pab.216.2015.12.14.16.26.45 for ; Mon, 14 Dec 2015 16:26:45 -0800 (PST) Subject: Re: [PATCH 31/32] x86, pkeys: execute-only support References: <20151214190542.39C4886D@viggo.jf.intel.com> <20151214190632.6A741188@viggo.jf.intel.com> <566F52CE.6080501@sr71.net> <566F5444.7000302@sr71.net> From: Dave Hansen Message-ID: <566F5E42.9000009@sr71.net> Date: Mon, 14 Dec 2015 16:26:42 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Kees Cook , LKML , Linux-MM , "x86@kernel.org" , Linus Torvalds , Andrew Morton , Dave Hansen On 12/14/2015 03:47 PM, Andy Lutomirski wrote: > On Mon, Dec 14, 2015 at 3:44 PM, Dave Hansen wrote: >> On 12/14/2015 03:39 PM, Andy Lutomirski wrote: >>>>> Nope. My linker-fu is weak. >>>>> >>>>> Can we even depend on the linker by itself? Even if the sections were >>>>> marked --x, we can't actually use them with those permissions unless we >>>>> have protection keys. >>>>> >>>>> Do we need some special tag on the section to tell the linker to map it >>>>> as --x under some conditions and r-x for others? >>>>> >>> Why? Wouldn't --x just end up acting like r-x if PKRU is absent? >> >> An app doing --x would expect it to be unreadable. I don't think we can >> just silently turn it in to r-x. > > I don't see why. After all, an app doing --x right now gets rx. An > app doing r-- still gets r-x on some systems. ... and you're right. I'd managed to convince myself otherwise, somehow. Let me go see if I can get the execve() code to make one of these mappings if I hand it properly-aligned sections. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org