]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ARM: 6877/1: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 13 Apr 2011 03:57:17 +0000 (04:57 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 14 Apr 2011 08:15:24 +0000 (09:15 +0100)
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/mmap.c

index afe209e1e1f85fb299e9822ea07a49b13cc29ecf..74be05f3e03ac58be921aff208c6f6aa460ab683 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/shm.h>
 #include <linux/sched.h>
 #include <linux/io.h>
+#include <linux/personality.h>
 #include <linux/random.h>
 #include <asm/cputype.h>
 #include <asm/system.h>
@@ -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: