From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()
Date: Thu, 14 Apr 2011 13:47:05 -0700 [thread overview]
Message-ID: <4DA75D49.1050003@codeaurora.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1104072249260.28032@xanadu.home>
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.
next prev parent reply other threads:[~2011-04-14 20:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2011-04-14 21:33 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DA75D49.1050003@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.