364473e
diff -uNrp kernel-3.2.fc16.orig/arch/x86/mm/mmap.c kernel-3.2.fc16.new/arch/x86/mm/mmap.c
364473e
--- kernel-3.2.fc16.orig/arch/x86/mm/mmap.c	2012-03-19 16:47:03.495169091 -0400
364473e
+++ kernel-3.2.fc16.new/arch/x86/mm/mmap.c	2012-03-19 16:50:03.574168052 -0400
364473e
@@ -106,6 +106,10 @@ static unsigned long mmap_legacy_base(vo
364473e
                return TASK_UNMAPPED_BASE + mmap_rnd();
364473e
 }
364473e
364473e
+#ifdef CONFIG_X86_32
364473e
+  #define SHLIB_BASE             0x00111000
364473e
+#endif
364473e
+
364473e
 /*
364473e
  * This function, called very early during the creation of a new
364473e
  * process VM image, sets up which VM layout function to use:
364473e
@@ -126,8 +126,10 @@ void arch_pick_mmap_layout(struct mm_str
364473e
 #ifdef CONFIG_X86_32
364473e
 		if (!(current->personality & READ_IMPLIES_EXEC)
364473e
 		    && !(__supported_pte_mask & _PAGE_NX)
364473e
-		    && mmap_is_ia32())
364473e
+		    && mmap_is_ia32()) {
364473e
+			mm->shlib_base = SHLIB_BASE + mmap_rnd();
364473e
 			mm->get_unmapped_exec_area = arch_get_unmapped_exec_area;
364473e
+		}
364473e
 #endif
364473e
 		mm->unmap_area = arch_unmap_area_topdown;
364473e
 	}
364473e
diff -uNrp kernel-3.2.fc16.orig/include/linux/mm_types.h kernel-3.2.fc16.new/include/linux/mm_types.h
364473e
--- kernel-3.2.fc16.orig/include/linux/mm_types.h	2012-03-19 16:46:47.382169153 -0400
364473e
+++ kernel-3.2.fc16.new/include/linux/mm_types.h	2012-03-19 16:50:40.738168219 -0400
364473e
@@ -300,6 +300,7 @@ struct mm_struct {
364473e
 	void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
364473e
 #endif
364473e
 	unsigned long mmap_base;		/* base of mmap area */
364473e
+	unsigned long shlib_base;		/* base of lib map area (ASCII armour)*/
364473e
 	unsigned long task_size;		/* size of task vm space */
364473e
 	unsigned long cached_hole_size; 	/* if non-zero, the largest hole below free_area_cache */
364473e
 	unsigned long free_area_cache;		/* first hole of size cached_hole_size or larger */
364473e
diff -uNrp kernel-3.2.fc16.orig/mm/mmap.c kernel-3.2.fc16.new/mm/mmap.c
364473e
--- kernel-3.2.fc16.orig/mm/mmap.c	2012-03-19 16:46:15.791169274 -0400
364473e
+++ kernel-3.2.fc16.new/mm/mmap.c	2012-03-19 16:51:37.351166875 -0400
364473e
@@ -1594,8 +1594,6 @@ static bool should_randomize(void)
364473e
 		!(current->personality & ADDR_NO_RANDOMIZE);
364473e
 }
364473e
 
364473e
-#define SHLIB_BASE	0x00110000
364473e
-
364473e
 unsigned long
364473e
 arch_get_unmapped_exec_area(struct file *filp, unsigned long addr0,
364473e
 		unsigned long len0, unsigned long pgoff, unsigned long flags)
364473e
@@ -1612,8 +1610,8 @@ arch_get_unmapped_exec_area(struct file
364473e
 		return addr;
364473e
 
364473e
 	if (!addr)
364473e
-		addr = !should_randomize() ? SHLIB_BASE :
364473e
-			randomize_range(SHLIB_BASE, 0x01000000, len);
364473e
+		addr = !should_randomize() ? mm->shlib_base :
364473e
+			randomize_range(mm->shlib_base, 0x01000000, len);
364473e
 
364473e
 	if (addr) {
364473e
 		addr = PAGE_ALIGN(addr);
364473e
@@ -1623,7 +1621,7 @@ arch_get_unmapped_exec_area(struct file
364473e
 			return addr;
364473e
 	}
364473e
 
364473e
-	addr = SHLIB_BASE;
364473e
+	addr = mm->shlib_base;
364473e
 	for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
364473e
 		/* At this point:  (!vma || addr < vma->vm_end). */
364473e
 		if (TASK_SIZE - len < addr)