From: Kees Cook <keescook@chromium.org>
To: Ard Biesheuvel <ard.biesheuvel@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hardening: add PROT_FINAL prot flag to mmap/mprotect
Date: Mon, 20 Aug 2012 11:00:37 -0700 [thread overview]
Message-ID: <20120820180037.GV4232@outflux.net> (raw)
In-Reply-To: <E1T1N2q-0001xm-5X@morero.ard.nu>
Hi,
On Tue, Aug 14, 2012 at 09:11:11PM +0200, Ard Biesheuvel wrote:
> This patch adds support for the PROT_FINAL flag to
> the mmap() and mprotect() syscalls.
>
> The PROT_FINAL flag indicates that the requested set
> of protection bits should be final, i.e., it shall
> not be allowed for a subsequent mprotect call to
> set protection bits that were not set already.
>
> This is mainly intended for the dynamic linker,
> which sets up the address space on behalf of
> dynamic binaries. By using this flag, it can
> prevent exploited code from remapping read-only
> executable code or data sections read-write.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
This seems like a good idea to me. It would allow more than just the
loader to harden userspace allocations. It's a more direct version of
PaX's "MPROTECT" feature[1]. That feature hardens existing loaders,
but doesn't play nice with JITs (like Java), but this lets a loader
(or JIT) opt-in to the protection and have some direct control over it.
It seems like there needs to be a sensible way to detect that this flag is
available, though.
-Kees
[1] http://pax.grsecurity.net/docs/mprotect.txt
--
Kees Cook @outflux.net
next prev parent reply other threads:[~2012-08-20 18:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-14 19:11 [PATCH] hardening: add PROT_FINAL prot flag to mmap/mprotect Ard Biesheuvel
2012-08-20 18:00 ` Kees Cook [this message]
2012-08-20 21:48 ` Ard Biesheuvel
2012-10-02 20:34 ` Kees Cook
2012-10-02 21:41 ` Ard Biesheuvel
2012-10-02 22:10 ` Kees Cook
2012-10-02 22:38 ` Andrew Morton
2012-10-03 0:43 ` Hugh Dickins
2012-10-03 14:43 ` Updated: " Ard Biesheuvel
2012-10-03 16:25 ` Kees Cook
2012-10-03 19:44 ` Hugh Dickins
2012-10-03 21:18 ` Andrew Morton
2012-10-03 22:19 ` Kees Cook
2012-10-03 22:25 ` Roland McGrath
2012-10-04 8:26 ` Ard Biesheuvel
2012-10-04 12:51 ` PaX Team
2012-10-04 13:56 ` Ard Biesheuvel
2012-10-06 13:11 ` PaX Team
2012-10-07 7:43 ` Ard Biesheuvel
2012-10-08 0:23 ` PaX Team
2012-10-10 18:26 ` halfdog
2012-10-04 8:18 ` Mikael Pettersson
2012-10-04 10:33 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120820180037.GV4232@outflux.net \
--to=keescook@chromium.org \
--cc=ard.biesheuvel@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).