diff options
author | Helge Deller <deller@gmx.de> | 2016-10-16 00:02:27 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2016-12-12 22:21:21 +0100 |
commit | 18d98a79382cbe5a7569788d5b7b18e7015506f2 (patch) | |
tree | bf5d3b90523528747e7a5d67bc9086c288a94ad5 /arch/parisc/kernel/process.c | |
parent | 69973b830859bc6529a7a0468ba0d80ee5117826 (diff) | |
download | lwn-18d98a79382cbe5a7569788d5b7b18e7015506f2.tar.gz lwn-18d98a79382cbe5a7569788d5b7b18e7015506f2.zip |
parisc: Enable KASLR
Add missing code for userspace executable address randomization, e.g.
applications compiled with the gcc -pie option.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/kernel/process.c')
-rw-r--r-- | arch/parisc/kernel/process.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 40639439d8b3..ea6603ee8d24 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -276,11 +276,7 @@ void *dereference_function_descriptor(void *ptr) static inline unsigned long brk_rnd(void) { - /* 8MB for 32bit, 1GB for 64bit */ - if (is_32bit_task()) - return (get_random_int() & 0x7ffUL) << PAGE_SHIFT; - else - return (get_random_int() & 0x3ffffUL) << PAGE_SHIFT; + return (get_random_int() & BRK_RND_MASK) << PAGE_SHIFT; } unsigned long arch_randomize_brk(struct mm_struct *mm) |