From: Nicolas Pitre Date: Wed, 13 Apr 2011 03:57:17 +0000 (+0100) Subject: ARM: 6877/1: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap() X-Git-Tag: upstream/snapshot3+hdmi~10530^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df5419a9a90ac4ea2d853d68cc788e32cfe71278;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ARM: 6877/1: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap() Signed-off-by: Nicolas Pitre Signed-off-by: Russell King --- diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index afe209e..74be05f 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +83,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, mm->cached_hole_size = 0; } /* 8 bits of randomness in 20 address space bits */ - if (current->flags & PF_RANDOMIZE) + if ((current->flags & PF_RANDOMIZE) && + !(current->personality & ADDR_NO_RANDOMIZE)) addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT; full_search: