All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhupesh Sharma <bhsharma@redhat.com>
To: Kees Cook <keescook@chromium.org>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"kernel-hardening@lists.openwall.com"
	<kernel-hardening@lists.openwall.com>,
	Daniel Cashman <dcashman@google.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Bhupesh SHARMA <bhupesh.linux@gmail.com>,
	Alexander Graf <agraf@suse.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Anatolij Gustschin <agust@denx.de>,
	Alistair Popple <alistair@popple.id.au>,
	Matt Porter <mporter@kernel.crashing.org>,
	Vitaly Bordug <vitb@kernel.crashing.org>,
	Scott Wood <oss@buserror.net>,
	Kumar Gala <galak@kernel.crashing.org>,
	Daniel Cashman <dcashman@android.com>
Subject: Re: [PATCH 0/2] RFC: Adjust powerpc ASLR elf randomness
Date: Thu, 2 Feb 2017 23:38:39 +0530	[thread overview]
Message-ID: <CACi5LpNrd+fqOCiA3HnJ6brTCW+v0c1tVPcfFS7Ms0tE0LXmQg@mail.gmail.com> (raw)
In-Reply-To: <CAGXu5jKYMLU1f3bWism+V59cuAeQnm7Fc9zncamq9S8guGR6TQ@mail.gmail.com>

Hi Kees,

Thanks for the review.
Please see my comments inline.

On Thu, Feb 2, 2017 at 7:51 PM, Kees Cook <keescook@chromium.org> wrote:
> On Wed, Feb 1, 2017 at 9:42 PM, Bhupesh Sharma <bhsharma@redhat.com> wrote:
>> This RFC patchset tries to make the powerpc ASLR elf randomness
>> implementation similar to other ARCHs (like x86).
>>
>> The 1st patch introduces the support of ARCH_MMAP_RND_BITS in powerpc
>> mmap implementation to allow a sane balance between increased randomness
>> in the mmap address of ASLR elfs and increased address space
>> fragmentation.
>>
>> The 2nd patch increases the ELF_ET_DYN_BASE value from the current
>> hardcoded value of 0x2000_0000 to something more practical,
>> i.e. TASK_SIZE - PAGE_SHIFT (which makes sense especially for
>> 64-bit platforms which would like to utilize more randomization
>> in the load address of a PIE elf).
>
> I don't think you want this second patch. Moving ELF_ET_DYN_BASE to
> the top of TASK_SIZE means you'll be constantly colliding with stack
> and mmap randomization. 0x20000000 is way better since it randomizes
> up from there towards the mmap area.
>
> Is there a reason to avoid the 32-bit memory range for the ELF addresses?
>
> -Kees

I think you are right. Hmm, I think I was going by my particular use
case which might not be required for generic PPC platforms.

I have one doubt though - I have primarily worked on arm64 and x86
architectures and there I see there 64-bit user space applications
using the 64-bit load addresses/ranges. I am not sure why PPC64 is
different historically.

Regards,
Bhupesh

WARNING: multiple messages have this Message-ID (diff)
From: Bhupesh Sharma <bhsharma@redhat.com>
To: Kees Cook <keescook@chromium.org>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"kernel-hardening@lists.openwall.com"
	<kernel-hardening@lists.openwall.com>,
	Daniel Cashman <dcashman@google.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Bhupesh SHARMA <bhupesh.linux@gmail.com>,
	Alexander Graf <agraf@suse.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Anatolij Gustschin <agust@denx.de>,
	Alistair Popple <alistair@popple.id.au>,
	Matt Porter <mporter@kernel.crashing.org>,
	Vitaly Bordug <vitb@kernel.crashing.org>,
	Scott Wood <oss@buserror.net>,
	Kumar Gala <galak@kernel.crashing.org>,
	Daniel Cashman <dcashman@android.com>
Subject: [kernel-hardening] Re: [PATCH 0/2] RFC: Adjust powerpc ASLR elf randomness
Date: Thu, 2 Feb 2017 23:38:39 +0530	[thread overview]
Message-ID: <CACi5LpNrd+fqOCiA3HnJ6brTCW+v0c1tVPcfFS7Ms0tE0LXmQg@mail.gmail.com> (raw)
In-Reply-To: <CAGXu5jKYMLU1f3bWism+V59cuAeQnm7Fc9zncamq9S8guGR6TQ@mail.gmail.com>

Hi Kees,

Thanks for the review.
Please see my comments inline.

On Thu, Feb 2, 2017 at 7:51 PM, Kees Cook <keescook@chromium.org> wrote:
> On Wed, Feb 1, 2017 at 9:42 PM, Bhupesh Sharma <bhsharma@redhat.com> wrote:
>> This RFC patchset tries to make the powerpc ASLR elf randomness
>> implementation similar to other ARCHs (like x86).
>>
>> The 1st patch introduces the support of ARCH_MMAP_RND_BITS in powerpc
>> mmap implementation to allow a sane balance between increased randomness
>> in the mmap address of ASLR elfs and increased address space
>> fragmentation.
>>
>> The 2nd patch increases the ELF_ET_DYN_BASE value from the current
>> hardcoded value of 0x2000_0000 to something more practical,
>> i.e. TASK_SIZE - PAGE_SHIFT (which makes sense especially for
>> 64-bit platforms which would like to utilize more randomization
>> in the load address of a PIE elf).
>
> I don't think you want this second patch. Moving ELF_ET_DYN_BASE to
> the top of TASK_SIZE means you'll be constantly colliding with stack
> and mmap randomization. 0x20000000 is way better since it randomizes
> up from there towards the mmap area.
>
> Is there a reason to avoid the 32-bit memory range for the ELF addresses?
>
> -Kees

I think you are right. Hmm, I think I was going by my particular use
case which might not be required for generic PPC platforms.

I have one doubt though - I have primarily worked on arm64 and x86
architectures and there I see there 64-bit user space applications
using the 64-bit load addresses/ranges. I am not sure why PPC64 is
different historically.

Regards,
Bhupesh

  reply	other threads:[~2017-02-02 18:08 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02  5:42 [PATCH 0/2] RFC: Adjust powerpc ASLR elf randomness Bhupesh Sharma
2017-02-02  5:42 ` [kernel-hardening] " Bhupesh Sharma
2017-02-02  5:42 ` [PATCH 1/2] powerpc: mm: support ARCH_MMAP_RND_BITS Bhupesh Sharma
2017-02-02  5:42   ` [kernel-hardening] " Bhupesh Sharma
2017-02-02  9:11   ` Balbir Singh
2017-02-02  9:11     ` [kernel-hardening] " Balbir Singh
2017-02-02 18:14     ` Bhupesh Sharma
2017-02-02 18:14       ` [kernel-hardening] " Bhupesh Sharma
2017-02-02 10:23   ` Michael Ellerman
2017-02-02 10:23     ` [kernel-hardening] " Michael Ellerman
2017-02-02 12:22     ` Balbir Singh
2017-02-02 12:22       ` [kernel-hardening] " Balbir Singh
2017-02-02 23:59       ` Michael Ellerman
2017-02-08 12:53     ` Bhupesh Sharma
2017-02-08 12:53       ` [kernel-hardening] " Bhupesh Sharma
2017-02-10 11:01       ` Michael Ellerman
2017-02-10 11:11         ` Bhupesh Sharma
2017-02-16  4:49           ` Bhupesh Sharma
2017-02-24  7:32             ` Bhupesh Sharma
2017-02-24  9:53               ` Michael Ellerman
2017-02-24  9:53                 ` Michael Ellerman
2017-02-02 14:25   ` Kees Cook
2017-02-02 14:25     ` [kernel-hardening] " Kees Cook
2017-02-02 18:04     ` Bhupesh Sharma
2017-02-02 18:04       ` [kernel-hardening] " Bhupesh Sharma
2017-02-02  5:42 ` [PATCH 2/2] powerpc: Redefine ELF_ET_DYN_BASE Bhupesh Sharma
2017-02-02  5:42   ` [kernel-hardening] " Bhupesh Sharma
2017-02-02  6:44 ` [PATCH 0/2] RFC: Adjust powerpc ASLR elf randomness Balbir Singh
2017-02-02  6:44   ` [kernel-hardening] " Balbir Singh
2017-02-02 18:21   ` Bhupesh Sharma
2017-02-02 18:21     ` [kernel-hardening] " Bhupesh Sharma
2017-02-02 14:21 ` Kees Cook
2017-02-02 14:21   ` [kernel-hardening] " Kees Cook
2017-02-02 18:08   ` Bhupesh Sharma [this message]
2017-02-02 18:08     ` Bhupesh Sharma
2017-02-02 19:19     ` Kees Cook
2017-02-02 19:19       ` [kernel-hardening] " Kees Cook
2017-02-02 19:43       ` Bhupesh Sharma
2017-02-02 19:43         ` [kernel-hardening] " Bhupesh Sharma

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=CACi5LpNrd+fqOCiA3HnJ6brTCW+v0c1tVPcfFS7Ms0tE0LXmQg@mail.gmail.com \
    --to=bhsharma@redhat.com \
    --cc=agraf@suse.com \
    --cc=agust@denx.de \
    --cc=alistair@popple.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=bhupesh.linux@gmail.com \
    --cc=dcashman@android.com \
    --cc=dcashman@google.com \
    --cc=galak@kernel.crashing.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=mporter@kernel.crashing.org \
    --cc=oss@buserror.net \
    --cc=paulus@samba.org \
    --cc=vitb@kernel.crashing.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.