From: Kostya Serebryany <kcc@google.com>
To: Kees Cook <keescook@google.com>
Cc: Daniel Micay <danielmicay@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Michal Hocko <mhocko@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Rik van Riel <riel@redhat.com>, Reid Kleckner <rnk@google.com>,
Peter Collingbourne <pcc@google.com>,
Evgeniy Stepanov <eugenis@google.com>
Subject: Re: binfmt_elf: use ELF_ET_DYN_BASE only for PIE breaks asan
Date: Mon, 7 Aug 2017 12:26:42 -0700 [thread overview]
Message-ID: <CAN=P9pg25a80so+RFxpUkm1=JAVtOj_T6CaO3GSZc2+A-PPk6A@mail.gmail.com> (raw)
In-Reply-To: <CAGXu5j+x=vFrd7Owu=CgQcF7YtFAgPxUVo6G=Jzk6fo6mOQZqg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2665 bytes --]
On Mon, Aug 7, 2017 at 12:21 PM, Kees Cook <keescook@google.com> wrote:
> On Mon, Aug 7, 2017 at 12:16 PM, Kostya Serebryany <kcc@google.com> wrote:
> >
> >
> > On Mon, Aug 7, 2017 at 12:12 PM, Kees Cook <keescook@google.com> wrote:
> >>
> >> On Mon, Aug 7, 2017 at 12:05 PM, Kostya Serebryany <kcc@google.com>
> wrote:
> >> >
> >> >
> >> > On Mon, Aug 7, 2017 at 11:59 AM, Kees Cook <keescook@google.com>
> wrote:
> >> >>
> >> >> On Mon, Aug 7, 2017 at 11:56 AM, Kostya Serebryany <kcc@google.com>
> >> >> wrote:
> >> >> > Is it possible to implement some userspace<=>kernel interface that
> >> >> > will
> >> >> > allow applications (sanitizers)
> >> >> > to request *fixed* address ranges from the kernel at startup (so
> that
> >> >> > the
> >> >> > kernel couldn't refuse)?
> >> >>
> >> >> Wouldn't building non-PIE accomplish this?
> >> >
> >> >
> >> > Well, many asan users do need PIE.
> >> > Then, non-PIE only applies to the main executable, all DSOs are still
> >> > PIC and the old change that moved DSOs from 0x7fff to 0x5555 caused us
> >> > quite
> >> > a bit of trouble too, even w/o PIE
> >>
> >> Hm? You can build non-PIE executables leaving all the DSOs PIC.
> >
> >
> > Yes, but this won't help if the users actually want PIE executables.
>
> But who wants a PIE executable that isn't randomized? (Or did I
> misunderstand you? You want to allow userspace to declare the
> randomization range?
Kind of.
> Doesn't *San use fixed addresses already, so ASLR
> isn't actually a security defense?
first of all, *San are not security mitigation tools, and if they weaken
ASLR -- that's fine.
(asan *may* be considered as a mitigation tool even though it weakens ASLR
because it provides stronger memory safety guarantees,
but it's still a weak mitigation, and an expensive one)
> And if we did have such an
> interface it would just lead us right back to security vulnerabilities
> like the one this fix was trying to deal with ...)
>
> >> If what you want is to entirely disable userspace ASLR under *San, you
> >> can just set the ADDR_NO_RANDOMIZE personality flag.
> >
> >
> > Mmm. How? Could you please elaborate?
> > Do you suggest to call personality(ADDR_NO_RANDOMIZE) and re-execute the
> > process?
> > Or can I somehow set ADDR_NO_RANDOMIZE at link time?
>
> I've normally seen it done with a launcher that sets the personality
> and execs the desired executable.
>
Oh, a launcher (e.g. just using setarch) would be a huge pain to deploy.
>
> Another future path would be to collapse the PIE load range into the
> DSO load range (as now done when a loader executes a PIE binary).
>
> -Kees
>
> --
> Kees Cook
> Pixel Security
>
[-- Attachment #2: Type: text/html, Size: 4277 bytes --]
next prev parent reply other threads:[~2017-08-07 19:26 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 17:24 Dmitry Vyukov
2017-08-07 17:33 ` Kostya Serebryany
2017-08-07 17:33 ` Kees Cook
2017-08-07 18:26 ` Kostya Serebryany
2017-08-07 18:36 ` Evgenii Stepanov
2017-08-07 18:40 ` Kees Cook
2017-08-07 18:51 ` Evgenii Stepanov
2017-08-07 18:57 ` Kees Cook
2017-08-07 19:03 ` Kostya Serebryany
2017-08-07 19:06 ` Kees Cook
2017-08-07 19:10 ` Kostya Serebryany
2017-08-07 19:24 ` Kees Cook
2017-08-07 19:32 ` Kostya Serebryany
2017-08-07 19:12 ` Evgenii Stepanov
2017-08-07 18:38 ` Daniel Micay
2017-08-07 18:45 ` Daniel Micay
2017-08-07 18:39 ` Kees Cook
2017-08-07 18:48 ` Daniel Micay
2017-08-07 18:52 ` Kees Cook
2017-08-07 18:56 ` Kostya Serebryany
2017-08-07 18:59 ` Kees Cook
2017-08-07 19:01 ` Daniel Micay
2017-08-07 19:05 ` Kostya Serebryany
2017-08-07 19:12 ` Kees Cook
2017-08-07 19:16 ` Kostya Serebryany
2017-08-07 19:21 ` Kees Cook
2017-08-07 19:26 ` Kostya Serebryany [this message]
2017-08-07 19:34 ` Kees Cook
2017-08-07 19:40 ` Kostya Serebryany
2017-08-07 19:42 ` Daniel Micay
2017-08-07 19:46 ` Kees Cook
2017-08-07 18:21 ` Daniel Micay
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='CAN=P9pg25a80so+RFxpUkm1=JAVtOj_T6CaO3GSZc2+A-PPk6A@mail.gmail.com' \
--to=kcc@google.com \
--cc=akpm@linux-foundation.org \
--cc=danielmicay@gmail.com \
--cc=dvyukov@google.com \
--cc=eugenis@google.com \
--cc=keescook@google.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=pcc@google.com \
--cc=riel@redhat.com \
--cc=rnk@google.com \
/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