linux-mips
[Top] [All Lists]

Re: mm: insure topdown mmap chooses addresses above security mini

To: Timothy Pepper <timothy.c.pepper@linux.intel.com>
Subject: Re: mm: insure topdown mmap chooses addresses above security minimum
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
Date: Tue, 24 Sep 2013 22:28:53 +0100
Cc: linux-mm@kvack.org, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org, linux-arm-kernel@lists.infradead.org, Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, linuxppc-dev@lists.ozlabs.org, Paul Mundt <lethal@linux-sh.org>, linux-sh@vger.kernel.org, "David S. Miller" <davem@davemloft.net>, sparclinux@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=efjon2CfsIn50qeKrPUl9XKs3kBqPAJQVSljeF6gFMM=; b=bsQNh8TsJi8G7Kgv0vEZlO1XEi7dGadhvs7Jrd7HNNIrtlBI0H5fp1oM4GiFlHH4ipnus55zLIVRkYanRrqJBGJSnTMI329ey/PuFYA/wGulB8CSSt95StM6yCBfSx9KrTkuPRPKTUlIl3f/CGRd2COOZeZSqvxrwgiuxQl6NFI=;
In-reply-to: <1380057811-5352-1-git-send-email-timothy.c.pepper@linux.intel.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1380057811-5352-1-git-send-email-timothy.c.pepper@linux.intel.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.19 (2009-01-05)
On Tue, Sep 24, 2013 at 02:23:31PM -0700, Timothy Pepper wrote:
> diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
> index 0c63562..0e7355d 100644
> --- a/arch/arm/mm/mmap.c
> +++ b/arch/arm/mm/mmap.c
> @@ -9,6 +9,7 @@
>  #include <linux/io.h>
>  #include <linux/personality.h>
>  #include <linux/random.h>
> +#include <linux/security.h>
>  #include <asm/cachetype.h>
>  
>  #define COLOUR_ALIGN(addr,pgoff)             \
> @@ -146,7 +147,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const 
> unsigned long addr0,
>  
>       info.flags = VM_UNMAPPED_AREA_TOPDOWN;
>       info.length = len;
> -     info.low_limit = PAGE_SIZE;
> +     info.low_limit = max(PAGE_SIZE, PAGE_ALIGN(mmap_min_addr));
>       info.high_limit = mm->mmap_base;
>       info.align_mask = do_align ? (PAGE_MASK & (SHMLBA - 1)) : 0;
>       info.align_offset = pgoff << PAGE_SHIFT;

This looks sane for ARM.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

Thanks.

<Prev in Thread] Current Thread [Next in Thread>