linux-stable/arch/arm
Kees Cook fbbc400f39 arm: factor out mmap ASLR into mmap_rnd
To address the "offset2lib" ASLR weakness[1], this separates ET_DYN ASLR
from mmap ASLR, as already done on s390.  The architectures that are
already randomizing mmap (arm, arm64, mips, powerpc, s390, and x86), have
their various forms of arch_mmap_rnd() made available via the new
CONFIG_ARCH_HAS_ELF_RANDOMIZE.  For these architectures,
arch_randomize_brk() is collapsed as well.

This is an alternative to the solutions in:
https://lkml.org/lkml/2015/2/23/442

I've been able to test x86 and arm, and the buildbot (so far) seems happy
with building the rest.

[1] http://cybersecurity.upv.es/attacks/offset2lib/offset2lib.html

This patch (of 10):

In preparation for splitting out ET_DYN ASLR, this moves the ASLR
calculations for mmap on ARM into a separate routine, similar to x86.
This also removes the redundant check of personality (PF_RANDOMIZE is
already set before calling arch_pick_mmap_layout).

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Hector Marco-Gisbert <hecmargi@upv.es>
Cc: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: "David A. Long" <dave.long@linaro.org>
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Arun Chandran <achandran@mvista.com>
Cc: Yann Droneaud <ydroneaud@opteya.com>
Cc: Min-Hua Chen <orca.chen@gmail.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Alex Smith <alex@alex-smith.me.uk>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Vineeth Vijayan <vvijayan@mvista.com>
Cc: Jeff Bailey <jeffbailey@google.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Behan Webster <behanw@converseincode.com>
Cc: Ismael Ripoll <iripoll@upv.es>
Cc: Jan-Simon Mller <dl9pf@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-14 16:49:05 -07:00
..
boot USB patches for 4.1-rc1 2015-04-13 17:07:21 -07:00
common arm/bL_switcher: Kill tick suspend hackery 2015-04-01 14:23:00 +02:00
configs ARM: vexpress: update CONFIG_USB_ISP1760 option 2015-03-11 15:37:21 +01:00
crypto crypto: arm/aes update NEON AES module to latest OpenSSL version 2015-03-02 23:18:26 +13:00
firmware
include Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 11:08:28 -07:00
kernel Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 11:08:28 -07:00
kvm KVM/ARM changes for v4.1: 2015-04-07 18:09:20 +02:00
lib
mach-asm9260 clockevents: asm9260: Fix compilation error with sparc/sparc64 allyesconfig 2015-02-25 10:28:22 +01:00
mach-at91 ARM: at91: pm_slowclock: fix the compilation error 2015-03-11 15:49:47 +01:00
mach-axxia ARM: make arrays containing machine compatible strings const 2015-02-19 09:44:17 +01:00
mach-bcm ARM: make arrays containing machine compatible strings const 2015-02-19 09:44:17 +01:00
mach-berlin
mach-clps711x
mach-cns3xxx Merge branch 'pci/config' into next 2015-02-02 14:49:29 -06:00
mach-davinci ARM: make of_device_ids const 2015-02-19 09:44:25 +01:00
mach-digicolor ARM: digicolor: select syscon and timer 2015-01-29 13:52:06 -08:00
mach-dove PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos irqchip core change for v4.1 (round 3) 2015-04-11 11:17:28 +02:00
mach-footbridge
mach-gemini
mach-highbank ARM: make arrays containing machine compatible strings const 2015-02-19 09:44:17 +01:00
mach-hisi ARM: make arrays containing machine compatible strings const 2015-02-19 09:44:17 +01:00
mach-imx irqchip core changes for v4.1 (round 2) 2015-04-11 11:15:38 +02:00
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx ARM: ixp4xx: fix {in,out}s{bwl} data types 2015-02-18 12:20:27 +01:00
mach-keystone ARM: make of_device_ids const 2015-02-19 09:44:25 +01:00
mach-ks8695 Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2015-02-12 08:51:56 -08:00
mach-lpc32xx
mach-mediatek
mach-meson
mach-mmp ARM: make of_device_ids const 2015-02-19 09:44:25 +01:00
mach-moxart
mach-msm net: smc91x: use run-time configuration on all ARM machines 2015-02-28 12:56:56 -05:00
mach-mv78xx0 PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
mach-mvebu ARM: make of_device_ids const 2015-02-19 09:44:25 +01:00
mach-mxs
mach-netx
mach-nomadik
mach-nspire ARM: make arrays containing machine compatible strings const 2015-02-19 09:44:17 +01:00
mach-omap1 ARM: SoC cleanups 2015-02-17 09:17:33 -08:00
mach-omap2 Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 15:54:50 -07:00
mach-orion5x PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
mach-picoxcell
mach-prima2 ARM: make of_device_ids const 2015-02-19 09:44:25 +01:00
mach-pxa power supply and reset changes for the v4.1 series 2015-04-13 15:21:34 -07:00
mach-qcom ARM: SoC platform changes 2015-02-17 09:27:54 -08:00
mach-realview net: smc91x: use run-time configuration on all ARM machines 2015-02-28 12:56:56 -05:00
mach-rockchip ARM: rockchip: force built-in regulator support for PM 2015-02-18 12:20:30 +01:00
mach-rpc
mach-s3c24xx
mach-s3c64xx
mach-s5pv210 ARM: make arrays containing machine compatible strings const 2015-02-19 09:44:17 +01:00
mach-sa1100 ARM: fix typos in smc91x platform data 2015-03-04 23:32:26 -05:00
mach-shmobile ARM: shmobile: remove use of gic_arch_extn.irq_set_wake 2015-03-15 01:28:09 +00:00
mach-socfpga ARM: socfpga: make sure socfpga_cpu1start_addr is properly flushed 2015-03-04 13:03:17 -06:00
mach-spear
mach-sti ARM: STi: Add STiH410 SoC support 2015-03-11 15:34:45 +01:00
mach-sunxi ARM: sunxi: Have ARCH_SUNXI select RESET_CONTROLLER for clock driver usage 2015-02-23 10:44:54 +01:00
mach-tegra Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 15:54:50 -07:00
mach-u300
mach-ux500 ARM: ux500: switch from gic_arch_extn to gic_set_irqchip_flags 2015-03-15 01:28:11 +00:00
mach-versatile ARM: make arrays containing machine compatible strings const 2015-02-19 09:44:17 +01:00
mach-vexpress ARM: vexpress: use ARM_CPU_SUSPEND if needed 2015-02-18 12:19:09 +01:00
mach-vt8500
mach-w90x900
mach-zynq ARM: zynq: switch from gic_arch_extn to gic_set_irqchip_flags 2015-03-15 01:28:12 +00:00
mm arm: factor out mmap ASLR into mmap_rnd 2015-04-14 16:49:05 -07:00
net
nwfpe
oprofile
plat-iop arm: iop: specify PMUs are for XScale CPUs 2015-02-06 00:12:59 -08:00
plat-omap ARM, clocksource/drivers: Provide read_boot_clock64() and read_persistent_clock64() and use them 2015-04-03 08:18:23 +02:00
plat-orion
plat-pxa
plat-samsung ARM: SoC platform changes 2015-02-17 09:27:54 -08:00
plat-versatile
probes ARM: kprobes: Fix compilation error caused by superfluous '*' 2015-02-10 15:05:30 +08:00
tools
vfp
xen
Kconfig arm: expose number of page table levels on Kconfig level 2015-04-14 16:49:01 -07:00
Kconfig-nommu
Kconfig.debug ARM: SoC platform changes 2015-02-17 09:27:54 -08:00
Makefile ARM: digicolor: add the machine directory to Makefile 2015-03-11 15:36:34 +01:00