]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/parisc/kernel/sys_parisc.c
parisc: Enable KASLR
[karo-tx-linux.git] / arch / parisc / kernel / sys_parisc.c
index 0a393a04e89182cba498fa64774dd32177860eb7..a81e177cac7be0c7d1d0f86f0a871d350fea5fdc 100644 (file)
@@ -225,19 +225,17 @@ static unsigned long mmap_rnd(void)
 {
        unsigned long rnd = 0;
 
-       /*
-       *  8 bits of randomness in 32bit mmaps, 20 address space bits
-       * 28 bits of randomness in 64bit mmaps, 40 address space bits
-       */
-       if (current->flags & PF_RANDOMIZE) {
-               if (is_32bit_task())
-                       rnd = get_random_int() % (1<<8);
-               else
-                       rnd = get_random_int() % (1<<28);
-       }
+       if (current->flags & PF_RANDOMIZE)
+               rnd = get_random_int() & MMAP_RND_MASK;
+
        return rnd << PAGE_SHIFT;
 }
 
+unsigned long arch_mmap_rnd(void)
+{
+       return (get_random_int() & MMAP_RND_MASK) << PAGE_SHIFT;
+}
+
 static unsigned long mmap_legacy_base(void)
 {
        return TASK_UNMAPPED_BASE + mmap_rnd();