arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region
authorYueyi Li <liyueyi@live.com>
Mon, 24 Dec 2018 07:40:07 +0000 (07:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2019 06:36:44 +0000 (08:36 +0200)
commitda6c4933cd5795e115124e50f93bc5426dec19a0
tree0d0722e543852ec74350a77dc41107a5d3989969
parent91f69a3c910f97215e8f49207497084c472d1fa3
arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region

[ Upstream commit c8a43c18a97845e7f94ed7d181c11f41964976a2 ]

When KASLR is enabled (CONFIG_RANDOMIZE_BASE=y), the top 4K of kernel
virtual address space may be mapped to physical addresses despite being
reserved for ERR_PTR values.

Fix the randomization of the linear region so that we avoid mapping the
last page of the virtual address space.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: liyueyi <liyueyi@live.com>
[will: rewrote commit message; merged in suggestion from Ard]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
arch/arm64/mm/init.c