From 4eb3dad029be014e8504a38c36be0c5a88c867c4 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Mon, 14 Jun 2010 21:16:19 -0400 Subject: [PATCH] --- yaml --- r: 201503 b: refs/heads/master c: cc92c28b2db5b406657ecc05235d4ca4e222ae34 h: refs/heads/master i: 201501: ca39bd2814ab1832313ca65ff5620f15df5557ed 201499: 98565adf78c6ba71f32f4bc177971376bdc9fb0e 201495: 3037631abf8d65d84a466b74a461af66d635cff9 201487: 27b2dbb0f4c226a01795ecd79ece59b3618a88a6 201471: a90e29614ea0e44241216af0bec0ba31fe52054f v: v3 --- [refs] | 2 +- trunk/arch/arm/mm/mmap.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 186c5b1da32a..79dadce66eef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 990cb8acf23cab19a2930f1ed5e7dc108f89079b +refs/heads/master: cc92c28b2db5b406657ecc05235d4ca4e222ae34 diff --git a/trunk/arch/arm/mm/mmap.c b/trunk/arch/arm/mm/mmap.c index f5abc51c5a07..4f5b39687df5 100644 --- a/trunk/arch/arm/mm/mmap.c +++ b/trunk/arch/arm/mm/mmap.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, start_addr = addr = TASK_UNMAPPED_BASE; mm->cached_hole_size = 0; } + /* 8 bits of randomness in 20 address space bits */ + if (current->flags & PF_RANDOMIZE) + addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT; full_search: if (do_align)