linux/arch/arm64
Ard Biesheuvel 97d6786e06 arm64: mm: account for hotplug memory when randomizing the linear region
As a hardening measure, we currently randomize the placement of
physical memory inside the linear region when KASLR is in effect.
Since the random offset at which to place the available physical
memory inside the linear region is chosen early at boot, it is
based on the memblock description of memory, which does not cover
hotplug memory. The consequence of this is that the randomization
offset may be chosen such that any hotplugged memory located above
memblock_end_of_DRAM() that appears later is pushed off the end of
the linear region, where it cannot be accessed.

So let's limit this randomization of the linear region to ensure
that this can no longer happen, by using the CPU's addressable PA
range instead. As it is guaranteed that no hotpluggable memory will
appear that falls outside of that range, we can safely put this PA
range sized window anywhere in the linear region.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Steven Price <steven.price@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20201014081857.3288-1-ardb@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2020-11-10 18:43:25 +00:00
..
boot Amlogic fixes for v5.10-rc1 2020-10-27 10:44:11 +01:00
configs arm64: defconfig: Build in CONFIG_GPIO_MXC by default 2020-10-26 15:48:58 +08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2020-10-13 08:50:16 -07:00
include arm64 fixes for -rc3 2020-11-06 12:42:49 -08:00
kernel arm64 fixes for -rc3 2020-11-06 12:42:49 -08:00
kvm ARM: 2020-11-01 09:43:32 -08:00
lib arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S 2020-10-30 08:32:31 +00:00
mm arm64: mm: account for hotplug memory when randomizing the linear region 2020-11-10 18:43:25 +00:00
net arm64: bpf: Fix branch offset in JIT 2020-09-17 12:05:36 +01:00
xen
Kbuild
Kconfig arm64: NUMA: Kconfig: Increase NODES_SHIFT to 4 2020-11-03 09:31:53 +00:00
Kconfig.debug arm64: remove TEXT_OFFSET randomization 2020-06-15 13:10:59 +01:00
Kconfig.platforms arm64: berlin: Select DW_APB_TIMER_OF 2020-10-26 10:45:03 +01:00
Makefile More arm64 updates for 5.10 2020-10-23 09:46:16 -07:00