powerpc: ppc64 address space capped at 32TB, mmap randomisation disabled
authorAnton Blanchard <anton@samba.org>
Mon, 18 Nov 2013 03:55:28 +0000 (14:55 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2013 19:11:51 +0000 (11:11 -0800)
commit3ee8b4e1d91204180081d04c964ee5e0c7387f27
tree9df9998e8cc242f9b069cdd8a979e1b6f7eb121e
parent36cfdef6ffa08c5f3b1f812332eddd8aa4d91ed2
powerpc: ppc64 address space capped at 32TB, mmap randomisation disabled

commit 5a049f14902982c26538250bdc8d54156d357252 upstream.

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.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Michel Lespinasse <walken@google.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/mm/slice.c