]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s/radix: Fix 128TB-512TB virtual address boundary case allocation
authorNicholas Piggin <npiggin@gmail.com>
Thu, 9 Nov 2017 17:27:39 +0000 (04:27 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 13 Nov 2017 12:35:29 +0000 (23:35 +1100)
commit947370d1b384a982ec94da54c87878c0548a2159
tree0347d790c2875442675cdf9de7b574e26520426d
parenta586b3922adb2f38dc0486474dcc4a8a8f4d0643
powerpc/64s/radix: Fix 128TB-512TB virtual address boundary case allocation

Radix VA space allocations test addresses against mm->task_size which
is 512TB, even in cases where the intention is to limit allocation to
below 128TB.

This results in mmap with a hint address below 128TB but address +
length above 128TB succeeding when it should fail (as hash does after
the previous patch).

Set the high address limit to be considered up front, and base
subsequent allocation checks on that consistently.

Fixes: 13c0cf9060ea ("powerpc/mm: Enable mappings above 128TB")
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/hugetlbpage-radix.c
arch/powerpc/mm/mmap.c