diff options
author | Anton Blanchard <anton@samba.org> | 2013-11-17 22:55:28 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-11-20 18:33:41 -0500 |
commit | 5a049f14902982c26538250bdc8d54156d357252 (patch) | |
tree | 32c5263ce80a6d96ec35a66edac9ec6e97774944 /arch/powerpc | |
parent | 6d888d1ab0000dff8ea2901bcdf5d213f2a54e8b (diff) |
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@vger.kernel.org # v3.10+
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Michel Lespinasse <walken@google.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/slice.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index 3e99c149271a..7ce9cf3b6988 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, | |||
258 | slice = GET_HIGH_SLICE_INDEX(addr); | 258 | slice = GET_HIGH_SLICE_INDEX(addr); |
259 | *boundary_addr = (slice + end) ? | 259 | *boundary_addr = (slice + end) ? |
260 | ((slice + end) << SLICE_HIGH_SHIFT) : SLICE_LOW_TOP; | 260 | ((slice + end) << SLICE_HIGH_SHIFT) : SLICE_LOW_TOP; |
261 | return !!(available.high_slices & (1u << slice)); | 261 | return !!(available.high_slices & (1ul << slice)); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | 264 | ||