[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ubuntu-devel
Subject:    Unperformant Restrictions for non-x86_32 archs
From:       dieter.miosga () gmx ! de (Dieter Miosga)
Date:       2012-02-29 9:19:48
Message-ID: 4F4DEDB4.1080002 () gmx ! de
[Download RAW message or body]

Please change in file linux_32.0-17.27.diff
at line 5268, and all following and preceding occurences , to

--- linux-3.2.0.orig/arch/x86/kernel/process.c
+++ linux-3.2.0/arch/x86/kernel/process.c
@@ -663,6 +663,16 @@
  unsigned long arch_randomize_brk(struct mm_struct *mm)
  {
      unsigned long range_end = mm->brk + 0x02000000;
-    return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
+#ifdef CONFIG_X86_32
+    unsigned long bump = 0;
+    /* when using ASLR in arch_get_unmapped_exec_area, we must shove
+       the brk segment way out of the way of the exec area, since it
+       can collide with future allocations if not. */
+    if ( (mm->get_unmapped_exec_area == arch_get_unmapped_exec_area) &&
+         (mm->brk < 0x08000000) ) {
+        bump = (TASK_SIZE/6);
+    }
+    return bump + (randomize_range(mm->brk, range_end, 0) ? : mm->brk);
+#else
+    return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
+#endif

  }


Sincerely,
Dieter Miosga


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic