summaryrefslogtreecommitdiffstats
path: root/linux-2.6-32bit-mmap-exec-randomization.patch
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@redhat.com>2012-05-25 09:03:50 -0400
committerJosh Boyer <jwboyer@redhat.com>2012-05-25 09:03:50 -0400
commite3ad20d482bb27ca42482280692ece86f0876904 (patch)
treecbcc2ac4e422ef802ef4a18c41256acede4be0a6 /linux-2.6-32bit-mmap-exec-randomization.patch
parent2a6c66eb954a997fd019c5465cc46662b6acaf34 (diff)
downloadkernel-e3ad20d482bb27ca42482280692ece86f0876904.tar.gz
kernel-e3ad20d482bb27ca42482280692ece86f0876904.tar.xz
kernel-e3ad20d482bb27ca42482280692ece86f0876904.zip
Linux v3.4-7644-g07acfc2
Diffstat (limited to 'linux-2.6-32bit-mmap-exec-randomization.patch')
-rw-r--r--linux-2.6-32bit-mmap-exec-randomization.patch39
1 files changed, 15 insertions, 24 deletions
diff --git a/linux-2.6-32bit-mmap-exec-randomization.patch b/linux-2.6-32bit-mmap-exec-randomization.patch
index e4936991a..f6079841d 100644
--- a/linux-2.6-32bit-mmap-exec-randomization.patch
+++ b/linux-2.6-32bit-mmap-exec-randomization.patch
@@ -1,17 +1,8 @@
-Before:
-Heap randomisation test (PIE) : 16 bits (guessed)
-Main executable randomisation (PIE) : 8 bits (guessed)
-
-after:
-Heap randomisation test (PIE) : 19 bits (guessed)
-Main executable randomisation (PIE) : 12 bits (guessed)
-
-
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
-index 1d92a5a..81fef23 100644
+index 735279e..0f9f005 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
-@@ -753,6 +753,16 @@ unsigned long arch_align_stack(unsigned long sp)
+@@ -756,6 +756,16 @@ unsigned long arch_align_stack(unsigned long sp)
unsigned long arch_randomize_brk(struct mm_struct *mm)
{
unsigned long range_end = mm->brk + 0x02000000;
@@ -60,10 +51,10 @@ index 66e6d93..b80cde7 100644
ret = addr;
goto up_fail;
diff --git a/include/linux/mm.h b/include/linux/mm.h
-index 74aa71b..d9971db 100644
+index 7d5c37f..92cb90d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
-@@ -1391,7 +1391,13 @@ extern int install_special_mapping(struct mm_struct *mm,
+@@ -1389,7 +1389,13 @@ extern int install_special_mapping(struct mm_struct *mm,
unsigned long addr, unsigned long len,
unsigned long flags, struct page **pages);
@@ -79,10 +70,10 @@ index 74aa71b..d9971db 100644
extern unsigned long mmap_region(struct file *file, unsigned long addr,
unsigned long len, unsigned long flags,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 3cc3062..b42f00b 100644
+index 26574c7..54a063d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
-@@ -293,6 +293,9 @@ struct mm_struct {
+@@ -294,6 +294,9 @@ struct mm_struct {
unsigned long (*get_unmapped_area) (struct file *filp,
unsigned long addr, unsigned long len,
unsigned long pgoff, unsigned long flags);
@@ -93,10 +84,10 @@ index 3cc3062..b42f00b 100644
#endif
unsigned long mmap_base; /* base of mmap area */
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 81a173c..3f9f5c4 100644
+index f45c0b2..7234f1d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -390,6 +390,10 @@ extern void arch_pick_mmap_layout(struct mm_struct *mm);
+@@ -391,6 +391,10 @@ extern void arch_pick_mmap_layout(struct mm_struct *mm);
extern unsigned long
arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
unsigned long, unsigned long);
@@ -108,18 +99,18 @@ index 81a173c..3f9f5c4 100644
arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
unsigned long len, unsigned long pgoff,
diff --git a/mm/mmap.c b/mm/mmap.c
-index 848ef52..65650a5 100644
+index e8dcfc7..4bb6ac9 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
-@@ -30,6 +30,7 @@
- #include <linux/perf_event.h>
+@@ -31,6 +31,7 @@
#include <linux/audit.h>
#include <linux/khugepaged.h>
+ #include <linux/uprobes.h>
+#include <linux/random.h>
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
-@@ -995,7 +996,8 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
+@@ -1013,7 +1014,8 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
/* Obtain the address to map to. we verify (or select) it and ensure
* that it represents a valid section of the address space.
*/
@@ -129,7 +120,7 @@ index 848ef52..65650a5 100644
if (addr & ~PAGE_MASK)
return addr;
-@@ -1580,8 +1582,8 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
+@@ -1603,8 +1605,8 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
}
unsigned long
@@ -140,7 +131,7 @@ index 848ef52..65650a5 100644
{
unsigned long (*get_area)(struct file *, unsigned long,
unsigned long, unsigned long, unsigned long);
-@@ -1594,7 +1596,11 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
+@@ -1617,7 +1619,11 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
if (len > TASK_SIZE)
return -ENOMEM;
@@ -153,7 +144,7 @@ index 848ef52..65650a5 100644
if (file && file->f_op && file->f_op->get_unmapped_area)
get_area = file->f_op->get_unmapped_area;
addr = get_area(file, addr, len, pgoff, flags);
-@@ -1608,8 +1614,83 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
+@@ -1631,8 +1637,83 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
return arch_rebalance_pgtables(addr, len);
}