linux-stable/arch/arm64
Mark Rutland c96833fa18 arm64/mm: Inhibit huge-vmap with ptdump
[ Upstream commit 7ba36eccb3 ]

The arm64 ptdump code can race with concurrent modification of the
kernel page tables. At the time this was added, this was sound as:

* Modifications to leaf entries could result in stale information being
  logged, but would not result in a functional problem.

* Boot time modifications to non-leaf entries (e.g. freeing of initmem)
  were performed when the ptdump code cannot be invoked.

* At runtime, modifications to non-leaf entries only occurred in the
  vmalloc region, and these were strictly additive, as intermediate
  entries were never freed.

However, since commit:

  commit 324420bf91 ("arm64: add support for ioremap() block mappings")

... it has been possible to create huge mappings in the vmalloc area at
runtime, and as part of this existing intermediate levels of table my be
removed and freed.

It's possible for the ptdump code to race with this, and continue to
walk tables which have been freed (and potentially poisoned or
reallocated). As a result of this, the ptdump code may dereference bogus
addresses, which could be fatal.

Since huge-vmap is a TLB and memory optimization, we can disable it when
the runtime ptdump code is in use to avoid this problem.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 324420bf91 ("arm64: add support for ioremap() block mappings")
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-19 08:20:57 +02:00
..
boot arm64: dts: marvell: armada-ap806: reserve PSCI area 2019-05-16 19:42:29 +02:00
configs arm64: defconfig: Enable Rockchip io-domain driver 2018-08-03 07:50:38 +02:00
crypto crypto: arm64/aes-neonbs - don't access already-freed walk.iv 2019-05-21 18:50:19 +02:00
include arm64: vdso: Fix clock_getres() for CLOCK_REALTIME 2019-05-31 06:47:26 -07:00
kernel arm64: cpu_ops: fix a leaked reference by adding missing of_node_put 2019-05-31 06:47:30 -07:00
kvm arm64: KVM: Make VHE Stage-2 TLB invalidation operations non-interruptible 2019-05-16 19:42:28 +02:00
lib arm64: lse: remove -fcall-used-x0 flag 2018-11-13 11:15:12 -08:00
mm arm64/mm: Inhibit huge-vmap with ptdump 2019-06-19 08:20:57 +02:00
net bpf, arm64: remove prefetch insn in xadd mapping 2019-05-21 18:50:16 +02:00
xen arm64: kpti: Fix the interaction between ASID switching and software PAN 2018-02-16 20:22:49 +01:00
Kconfig arm64: mm: always enable CONFIG_HOLES_IN_ZONE 2018-09-09 19:56:02 +02:00
Kconfig.debug
Kconfig.platforms arm64: rockchip: Force CONFIG_PM on Rockchip systems 2018-09-15 09:45:33 +02:00
Makefile arm64: relocatable: fix inconsistencies in linker script and options 2019-01-13 10:01:06 +01:00