Skip to content

Commit

Permalink
powerpc: ppc64 address space capped at 32TB, mmap randomisation disabled
Browse files Browse the repository at this point in the history
Commit fba2369 (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: [email protected] # v3.10+
Signed-off-by: Anton Blanchard <[email protected]>
Acked-by: Michel Lespinasse <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
antonblanchard authored and ozbenh committed Nov 20, 2013
1 parent 6d888d1 commit 5a049f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/mm/slice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down

0 comments on commit 5a049f1

Please sign in to comment.