powerpc: ppc64 address space capped at 32TB, mmap randomisation disabled

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:02 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=5a049f14902982c26538250bdc8d54156d357252
Commit:     5a049f14902982c26538250bdc8d54156d357252
Parent:     6d888d1ab0000dff8ea2901bcdf5d213f2a54e8b
Author:     Anton Blanchard <anton at samba.org>
AuthorDate: Mon Nov 18 14:55:28 2013 +1100
Committer:  Benjamin Herrenschmidt <benh at kernel.crashing.org>
CommitDate: Thu Nov 21 10:33:41 2013 +1100

    powerpc: ppc64 address space capped at 32TB, mmap randomisation disabled
    
    Commit fba2369e6ceb (mm: use vm_unmapped_area() on powerpc architecture)
    has a bug in slice_scan_available() where we compare an unsigned long
    (high_slices) against a shifted int. As a result, comparisons against
    the top 32 bits of high_slices (representing the top 32TB) always
    returns 0 and the top of our mmap region is clamped at 32TB
    
    This also breaks mmap randomisation since the randomised address is
    always up near the top of the address space and it gets clamped down
    to 32TB.
    
    Cc: stable at vger.kernel.org # v3.10+
    Signed-off-by: Anton Blanchard <anton at samba.org>
    Acked-by: Michel Lespinasse <walken at google.com>
    Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 arch/powerpc/mm/slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 3e99c14..7ce9cf3 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -258,7 +258,7 @@ static bool slice_scan_available(unsigned long addr,
 		slice = GET_HIGH_SLICE_INDEX(addr);
 		*boundary_addr = (slice + end) ?
 			((slice + end) << SLICE_HIGH_SHIFT) : SLICE_LOW_TOP;
-		return !!(available.high_slices & (1u << slice));
+		return !!(available.high_slices & (1ul << slice));
 	}
 }
 



More information about the linux-mtd-cvs mailing list