linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()
@ 2011-04-08  2:51 Nicolas Pitre
  2011-04-14 20:47 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Pitre @ 2011-04-08  2:51 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
---
 arch/arm/mm/mmap.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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 <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:
-- 
1.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 1/2] ARM: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()
  2011-04-08  2:51 [PATCH 1/2] ARM: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap() Nicolas Pitre
@ 2011-04-14 20:47 ` Stephen Boyd
  2011-04-14 21:33   ` Nicolas Pitre
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2011-04-14 20:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/07/2011 07:51 PM, Nicolas Pitre wrote:
> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> ---

Is this a stable candidate?

>  arch/arm/mm/mmap.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> 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 <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:


-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] ARM: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()
  2011-04-14 20:47 ` Stephen Boyd
@ 2011-04-14 21:33   ` Nicolas Pitre
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Pitre @ 2011-04-14 21:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 14 Apr 2011, Stephen Boyd wrote:

> On 04/07/2011 07:51 PM, Nicolas Pitre wrote:
> > Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> > ---
> 
> Is this a stable candidate?

Maybe, but OTOH this is not critical.  You also need to have 
CONFIG_COMPAT_BRK=n before this makes any difference, and that option is 
enabled by default.


Nicolas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-14 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-08  2:51 [PATCH 1/2] ARM: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap() Nicolas Pitre
2011-04-14 20:47 ` Stephen Boyd
2011-04-14 21:33   ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).