1
0
Fork 0
remarkable-linux/arch
Kees Cook c715b72c1b mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes
Moving the x86_64 and arm64 PIE base from 0x555555554000 to 0x000100000000
broke AddressSanitizer.  This is a partial revert of:

  eab09532d4 ("binfmt_elf: use ELF_ET_DYN_BASE only for PIE")
  02445990a9 ("arm64: move ELF_ET_DYN_BASE to 4GB / 4MB")

The AddressSanitizer tool has hard-coded expectations about where
executable mappings are loaded.

The motivation for changing the PIE base in the above commits was to
avoid the Stack-Clash CVEs that allowed executable mappings to get too
close to heap and stack.  This was mainly a problem on 32-bit, but the
64-bit bases were moved too, in an effort to proactively protect those
systems (proofs of concept do exist that show 64-bit collisions, but
other recent changes to fix stack accounting and setuid behaviors will
minimize the impact).

The new 32-bit PIE base is fine for ASan (since it matches the ET_EXEC
base), so only the 64-bit PIE base needs to be reverted to let x86 and
arm64 ASan binaries run again.  Future changes to the 64-bit PIE base on
these architectures can be made optional once a more dynamic method for
dealing with AddressSanitizer is found.  (e.g.  always loading PIE into
the mmap region for marked binaries.)

Link: http://lkml.kernel.org/r/20170807201542.GA21271@beast
Fixes: eab09532d4 ("binfmt_elf: use ELF_ET_DYN_BASE only for PIE")
Fixes: 02445990a9 ("arm64: move ELF_ET_DYN_BASE to 4GB / 4MB")
Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Kostya Serebryany <kcc@google.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-08-18 15:32:02 -07:00
..
alpha tty: Fix TIOCGPTPEER ioctl definition 2017-07-17 17:04:41 +02:00
arc dma-coherent: introduce interface for default DMA pool 2017-07-20 16:09:10 +02:00
arm ARM: SoC fixes for 4.13 2017-08-18 11:08:48 -07:00
arm64 mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes 2017-08-18 15:32:02 -07:00
blackfin Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
c6x Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
cris Kbuild updates for v4.13 (2nd) 2017-07-13 13:37:57 -07:00
frv FRV: tlbflush: move asmlinkage before return type 2017-07-12 16:26:04 -07:00
h8300 h8300: Add missing closing parenthesis in flat_get_addr_from_rp() 2017-07-16 09:24:06 -07:00
hexagon hexagon: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:26 +09:00
ia64 mm: fix MADV_[FREE|DONTNEED] TLB flush miss problem 2017-08-10 15:54:07 -07:00
m32r Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
m68k blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes 2017-07-16 09:24:06 -07:00
metag metag: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:30 +09:00
microblaze Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
mips Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2017-08-13 15:34:28 -07:00
mn10300 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
nios2 nios2: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:43 +09:00
openrisc openrisc: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:50 +09:00
parisc parisc: Define CONFIG_CPU_BIG_ENDIAN 2017-07-31 17:51:27 +02:00
powerpc kernel/watchdog: fix Kconfig constraints for perf hardlockup watchdog 2017-08-18 15:32:01 -07:00
s390 mm: fix MADV_[FREE|DONTNEED] TLB flush miss problem 2017-08-10 15:54:07 -07:00
score Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
sh mm: fix MADV_[FREE|DONTNEED] TLB flush miss problem 2017-08-10 15:54:07 -07:00
sparc sparc64: Increase max_phys_bits to 51 and VA bits to 53 for M8. 2017-08-04 11:08:53 -07:00
tile Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
um mm: fix MADV_[FREE|DONTNEED] TLB flush miss problem 2017-08-10 15:54:07 -07:00
unicore32 unicore32: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:52 +09:00
x86 mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes 2017-08-18 15:32:02 -07:00
xtensa Xtensa fixes for v4.13-rc4 2017-08-07 18:58:10 -07:00
.gitignore
Kconfig include/linux/string.h: add the option of fortified string.h functions 2017-07-12 16:26:03 -07:00