提交 5a049f14 编写于 作者: A Anton Blanchard 提交者: Benjamin Herrenschmidt

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

Commit fba2369e (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: NAnton Blanchard <anton@samba.org>
Acked-by: NMichel Lespinasse <walken@google.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 6d888d1a
......@@ -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));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册