android_kernel_motorola_sm6225/arch/mips
Prem Karat ccd3988086 MIPS: Enable VDSO randomization
Based on commit 1091458d09 (mmap randomization)

For 32-bit address spaces randomize within a
16MB space, for 64-bit within a 256MB space.

Test Results:
------------
Without Patch (VDSO is not randomized)
---------------------------------------
root@Maleo:~# ./aslr vdso
FAIL: ASLR not functional (vdso always at 0x7fff7000)

root@Maleo:~# ./aslr rekey vdso
pre_val==cur_val
value=0x7fff7000

With patch:(VDSO is randmoized and doesn't interfere with stack)
----------------------------------------------------------------
root@cavium-octeon2:~# ./aslr rekey vdso
pre_val!=cur_val
previous_value=0x7f830ea2
current_value=0x776e2000
root@cavium-octeon2:~# ./aslr rekey vdso
pre_val!=cur_val
previous_value=0x7fb0cea2
current_value=0x77209000
root@cavium-octeon2:~# ./aslr rekey vdso
pre_val!=cur_val
previous_value=0x7f985ea2
current_value=0x7770c000
root@cavium-octeon2:~# ./aslr rekey vdso
pre_val!=cur_val
previous_value=0x7fbc6ea2
current_value=0x7fe25000

Maps file output:
-------------------------
root@cavium-octeon2:~# ./aslr rekey maps
78584000-785a5000 rwxp 00000000 00:00 0                                  [heap]
7f9d0000-7f9f1000 rw-p 00000000 00:00 0                                  [stack]
7ffa5000-7ffa6000 r-xp 00000000 00:00 0                                  [vdso]

root@cavium-octeon2:~# ./aslr rekey maps
77de0000-77e01000 rwxp 00000000 00:00 0                                  [heap]
7f91b000-7f93c000 rw-p 00000000 00:00 0                                  [stack]
7ff99000-7ff9a000 r-xp 00000000 00:00 0                                  [vdso]

root@cavium-octeon2:~# ./aslr rekey maps
77d7f000-77da0000 rwxp 00000000 00:00 0                                  [heap]
7fc2a000-7fc4b000 rw-p 00000000 00:00 0                                  [stack]
7fe09000-7fe0a000 r-xp 00000000 00:00 0                                  [vdso]

root@cavium-octeon2:~# ./aslr rekey maps
7794c000-7794d000 r-xp 00000000 00:00 0                                  [vdso]
77e4b000-77e6c000 rwxp 00000000 00:00 0                                  [heap]
7f6e7000-7f708000 rw-p 00000000 00:00 0                                  [stack]
root@cavium-octeon2:~#

Signed-off-by: Prem Karat <pkarat@mvista.com>
Cc: linux-mips@linux-mips.org
Cc: sergei.shtylyov@cogentembedded.com
Cc: ddaney.cavm@gmail.com
Patchwork: https://patchwork.linux-mips.org/patch/6812
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2014-11-24 07:45:38 +01:00
..
alchemy MIPS: Alchemy: Remove direct access to prepare_count field of struct clk 2014-11-24 07:45:17 +01:00
ar7 mips: Convert pr_warning to pr_warn 2014-11-24 07:44:51 +01:00
ath25 MIPS: ath25: add Wireless device support 2014-11-24 07:45:29 +01:00
ath79 MIPS: ath79: Read the initrd address from the firmware environment 2014-11-24 07:45:30 +01:00
bcm47xx MIPS: BCM47XX: Clean up nvram header 2014-11-24 07:45:08 +01:00
bcm63xx MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
bcm3384 MIPS: bcm3384: Initial commit of bcm3384 platform support 2014-11-24 07:45:13 +01:00
boot MIPS: bcm3384: Initial commit of bcm3384 platform support 2014-11-24 07:45:13 +01:00
cavium-octeon MIPS: Octeon: Mark octeon_model_get_string() with __init 2014-11-24 07:45:32 +01:00
cobalt MIPS: Cobalt: Move to 8250/16550 serial early printk driver 2013-10-29 21:24:38 +01:00
configs MIPS: bcm3384: Initial commit of bcm3384 platform support 2014-11-24 07:45:13 +01:00
dec Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-06-09 18:10:34 -07:00
emma MIPS: Remove panic_timeout settings 2013-11-26 12:12:27 +01:00
fw MIPS: FW: Use kstrtoul() to parse unsigned long from the fw environment 2014-11-24 07:45:26 +01:00
include MIPS: Remove a temporary hack for debugging cache flushes in SMTC configuration 2014-11-24 07:45:37 +01:00
jazz Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-03-02 07:44:16 -08:00
jz4740 This is the bulk of GPIO changes for the v3.17 development 2014-08-08 18:00:35 -07:00
kernel MIPS: Enable VDSO randomization 2014-11-24 07:45:38 +01:00
kvm KVM: remove garbage arg to *hardware_{en,dis}able 2014-08-29 16:35:55 +02:00
lantiq MIPS: lantiq: add missing spi clock on falcon SoC 2014-11-24 07:45:18 +01:00
lasat MIPS: Lasat: Add missing CONFIG_PROC_FS dependency to PICVUE_PROC 2014-10-21 17:35:44 +02:00
lib MIPS: lib: mips-atomic.c: Remove obsolete ifdefery 2014-11-24 07:45:33 +01:00
loongson MIPS: loongson: common: rtc: make loongson_rtc_resources static 2014-11-24 07:45:35 +01:00
loongson1 MIPS: Loongson1B: Add a clockevent/clocksource using PWM Timer 2014-11-24 07:45:09 +01:00
math-emu MIPS: Support for hybrid FPRs 2014-11-24 07:45:07 +01:00
mm MIPS: mm: Only build one microassembler that is suitable 2014-11-24 07:45:36 +01:00
mti-malta clocksource: mips-gic: Move gic_frequency to clocksource driver 2014-11-24 07:45:15 +01:00
mti-sead3 MIPS: Move gic.h to include/linux/irqchip/mips-gic.h 2014-11-24 07:44:59 +01:00
net Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-10-18 14:24:36 -07:00
netlogic MIPS: Netlogic: Move device-trees to arch/mips/boot/dts/ 2014-09-22 13:35:50 +02:00
oprofile MIPS: oprofile: Backtrace: don't fail on leaf functions 2014-11-24 07:45:31 +01:00
paravirt mips: Update the email address of Geert Uytterhoeven 2014-06-02 16:34:41 +02:00
pci MIPS: ath25: add AR2315 PCI host controller driver 2014-11-24 07:45:28 +01:00
pmcs-msp71xx MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
pnx833x MIPS: PNX833x: Remove checks for CONFIG_I2C_PNX0105 2014-05-23 15:12:39 +02:00
power nosave: consolidate __nosave_{begin,end} in <asm/sections.h> 2014-10-09 22:26:04 -04:00
ralink MIPS: ralink: add rt2880 pci driver 2014-11-24 07:45:25 +01:00
rb532 MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sgi-ip22 MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sgi-ip27 MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sgi-ip32 MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
sibyte MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sni MIPS: Cleanup CP0 PRId and CP1 FPIR register access masks 2013-09-18 20:25:19 +02:00
txx9 mips: Convert pr_warning to pr_warn 2014-11-24 07:44:51 +01:00
vr41xx MIPS: Idle: Consolidate all declarations in <asm/idle.h>. 2013-05-22 01:34:27 +02:00
Kbuild MIPS: net: Add BPF JIT 2014-05-30 16:10:20 +02:00
Kbuild.platforms MIPS: ath25: add common parts 2014-11-24 07:45:26 +01:00
Kconfig MIPS: Kconfig: Only allow 32-bit microMIPS builds 2014-11-24 07:45:36 +01:00
Kconfig.debug MIPS: Kconfig option to better exercise/debug hybrid FPRs 2014-11-24 07:45:08 +01:00
Makefile MIPS: IP22/IP32: Add line to arch/mips/Makefile archhelp about vmlinux.32 2014-11-24 07:45:33 +01:00