Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674763

Re: [PATCH 3/4] powerpc: Reduce ELF_ET_DYN_BASE

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] powerpc: Reduce ELF_ET_DYN_BASE
Date Mon, 26 Jun 2017 15:10:02 +0200
Message-ID <tWBWa-2LF-5@gated-at.bofh.it> (permalink)
References <tVeIi-8fG-11@gated-at.bofh.it> <tVeIi-8fG-9@gated-at.bofh.it> <tVqT8-7uy-7@gated-at.bofh.it> <tVD3X-6I5-11@gated-at.bofh.it>
User-Agent Notmuch/0.21 (https://notmuchmail.org)
MIME-Version 1.0
Content-Type text/plain
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 38
Organization linux.* mail to news gateway
X-Original-Cc Andrew Morton <akpm@linux-foundation.org>, Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Martin Schwidefsky <schwidefsky@de.ibm.com>, Heiko Carstens <heiko.carstens@de.ibm.com>, James Hogan <james.hogan@imgtec.com>, Pratyush Anand <panand@redhat.com>, Ingo Molnar <mingo@kernel.org>, "linux-arm-kernel\@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linuxppc-dev\@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>, "linux-s390\@vger.kernel.org" <linux-s390@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>, linux-arch <linux-arch@vger.kernel.org>, "kernel-hardening\@lists.openwall.com" <kernel-hardening@lists.openwall.com>
X-Original-Date Mon, 26 Jun 2017 23:04:58 +1000
X-Original-Message-ID <8737amew79.fsf@concordia.ellerman.id.au>
X-Original-References <1498154792-49952-1-git-send-email-keescook@chromium.org> <1498154792-49952-4-git-send-email-keescook@chromium.org> <87podvp4q1.fsf@concordia.ellerman.id.au> <CAGXu5jK7aHHRMZyZyrviBF+cLghWcH_D4PX_vMFOycHuF7EdLA@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1674763

Show key headers only | View raw


Kees Cook <keescook@chromium.org> writes:

> On Fri, Jun 23, 2017 at 12:01 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> Kees Cook <keescook@chromium.org> writes:
>>
>>> Now that explicitly executed loaders are loaded in the mmap region,
>>> position PIE binaries lower in the address space to avoid possible
>>> collisions with mmap or stack regions. For 64-bit, align to 4GB to
>>> allow runtimes to use the entire 32-bit address space for 32-bit
>>> pointers.
>>
>> The change log and subject are a bit out of whack with the actual patch
>> because previously we used 512MB.
>>
>> How about?
>>
>>   powerpc: Move ELF_ET_DYN_BASE to 4GB / 4MB
>>
>>   Now that explicitly executed loaders are loaded in the mmap region,
>>   we have more freedom to decide where we position PIE binaries in the
>>   address space to avoid possible collisions with mmap or stack regions.
>>
>>   For 64-bit, align to 4GB to allow runtimes to use the entire 32-bit
>>   address space for 32-bit pointers. On 32-bit use 4MB.
>
> Good idea, thanks. I'll resend the series with the commit logs updated.
>
>> Is there any particular reasoning behind the 4MB value on 32-bit?
>
> So, I've dug around a bit on this, and I *think* the rationale is to
> avoid mapping a possible 4MB page table entry when it won't be using
> at least a portion near the lower end (NULL address area covered
> blocked by mmap_min_addr). It seems to be mainly tradition, though.

OK, that is obscure, especially for CPUs that don't have a 4MB page
size. But consistency across arches is probably best regardless.

cheers

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3/4] powerpc: Reduce ELF_ET_DYN_BASE Kees Cook <keescook@chromium.org> - 2017-06-22 20:10 +0200
  Re: [PATCH 3/4] powerpc: Reduce ELF_ET_DYN_BASE Michael Ellerman <mpe@ellerman.id.au> - 2017-06-23 09:10 +0200
    Re: [PATCH 3/4] powerpc: Reduce ELF_ET_DYN_BASE Kees Cook <keescook@chromium.org> - 2017-06-23 22:10 +0200
      Re: [PATCH 3/4] powerpc: Reduce ELF_ET_DYN_BASE Michael Ellerman <mpe@ellerman.id.au> - 2017-06-26 15:10 +0200
        Re: [PATCH 3/4] powerpc: Reduce ELF_ET_DYN_BASE Kees Cook <keescook@chromium.org> - 2017-06-26 20:30 +0200

csiph-web