lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5j+7Yv36riu4TG_EksPkEz3XzMNRWvCde_6VrhmkWChxSA@mail.gmail.com>
Date:	Mon, 14 Dec 2015 15:39:31 -0800
From:	Kees Cook <keescook@...gle.com>
To:	Dave Hansen <dave@...1.net>
Cc:	LKML <linux-kernel@...r.kernel.org>, Linux-MM <linux-mm@...ck.org>,
	"x86@...nel.org" <x86@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andy Lutomirski <luto@...capital.net>,
	Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH 31/32] x86, pkeys: execute-only support

On Mon, Dec 14, 2015 at 3:37 PM, Dave Hansen <dave@...1.net> wrote:
> On 12/14/2015 12:05 PM, Kees Cook wrote:
>> On Mon, Dec 14, 2015 at 11:06 AM, Dave Hansen <dave@...1.net> wrote:
>>> > From: Dave Hansen <dave.hansen@...ux.intel.com>
>>> > Protection keys provide new page-based protection in hardware.
>>> > But, they have an interesting attribute: they only affect data
>>> > accesses and never affect instruction fetches.  That means that
>>> > if we set up some memory which is set as "access-disabled" via
>>> > protection keys, we can still execute from it.
> ...
>>> > I haven't found any userspace that does this today.
>> To realistically take advantage of this, it sounds like the linker
>> would need to know to keep bss and data page-aligned away from text,
>> and then set text to PROT_EXEC only?
>>
>> Do you have any example linker scripts for this?
>
> 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?

Yeah, dunno. I was curious to see this working on a real example
first, and then we could figure out how the linker should behave
generally. Sounds like we need some kind of ELF flag to say "please
use unreadable-exec memory mappings for this program, too.

-Kees

-- 
Kees Cook
Chrome OS & Brillo Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ