Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu,  2 Feb 2017 11:12:48 +0530
From: Bhupesh Sharma <bhsharma@...hat.com>
To: linuxppc-dev@...ts.ozlabs.org,
	kernel-hardening@...ts.openwall.com
Cc: dcashman@...gle.com,
	mpe@...erman.id.au,
	bhupesh.linux@...il.com,
	keescook@...omium.org,
	Bhupesh Sharma <bhsharma@...hat.com>,
	Alexander Graf <agraf@...e.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mackerras <paulus@...ba.org>,
	Anatolij Gustschin <agust@...x.de>,
	Alistair Popple <alistair@...ple.id.au>,
	Matt Porter <mporter@...nel.crashing.org>,
	Vitaly Bordug <vitb@...nel.crashing.org>,
	Scott Wood <oss@...error.net>,
	Kumar Gala <galak@...nel.crashing.org>,
	Daniel Cashman <dcashman@...roid.com>
Subject: [PATCH 2/2] powerpc: Redefine ELF_ET_DYN_BASE

Currently the powerpc arch uses a ELF_ET_DYN_BASE value of 0x20000000
which ends up pushing an elf to a load address which is 32-bit.

On 64-bit platforms, this might be too less especially when one is
trying to increase the randomness of the load address of the ASLR elfs
on such platforms.

This patch makes the powerpc platforms mimic the x86 ones, by ensuring
that the ELF_ET_DYN_BASE is calculated on basis of the current task's
TASK_SIZE.

Cc: Alexander Graf <agraf@...e.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Anatolij Gustschin <agust@...x.de>
Cc: Alistair Popple <alistair@...ple.id.au>
Cc: Matt Porter <mporter@...nel.crashing.org>
Cc: Vitaly Bordug <vitb@...nel.crashing.org>
Cc: Scott Wood <oss@...error.net>
Cc: Kumar Gala <galak@...nel.crashing.org>
Cc: Daniel Cashman <dcashman@...roid.com>
Cc: Kees Cook <keescook@...omium.org>
Signed-off-by: Bhupesh Sharma <bhsharma@...hat.com>
---
 arch/powerpc/include/asm/elf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index ee46ffef608e..dd035f6dd782 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -28,7 +28,7 @@
    the loader.  We need to make sure that it is out of the way of the program
    that it will "exec", and that there is sufficient room for the brk.  */
 
-#define ELF_ET_DYN_BASE	0x20000000
+#define ELF_ET_DYN_BASE	(TASK_SIZE - PAGE_SIZE)
 
 #define ELF_CORE_EFLAGS (is_elf2_task() ? 2 : 0)
 
-- 
2.7.4

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.