linux-stable/arch/arm64
Will Deacon a534759658 arm64: SW PAN: Point saved ttbr0 at the zero page when switching to init_mm
commit 0adbdfde8c upstream.

update_saved_ttbr0 mandates that mm->pgd is not swapper, since swapper
contains kernel mappings and should never be installed into ttbr0. However,
this means that callers must avoid passing the init_mm to update_saved_ttbr0
which in turn can cause the saved ttbr0 value to be out-of-date in the context
of the idle thread. For example, EFI runtime services may leave the saved ttbr0
pointing at the EFI page table, and kernel threads may end up with stale
references to freed page tables.

This patch changes update_saved_ttbr0 so that the init_mm points the saved
ttbr0 value to the empty zero page, which always exists and never contains
valid translations. EFI and switch can then call into update_saved_ttbr0
unconditionally.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Fixes: 39bc88e5e3 ("arm64: Disable TTBR0_EL1 during normal kernel execution")
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Reported-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-14 09:53:02 +01:00
..
boot ARM64: dts: meson-gxl: Add alternate ARM Trusted Firmware reserved memory zone 2017-11-30 08:40:58 +00:00
configs ARM/arm64: SoC platform updates for v4.14 2017-09-10 20:35:46 -07:00
crypto License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
include arm64: SW PAN: Point saved ttbr0 at the zero page when switching to init_mm 2017-12-14 09:53:02 +01:00
kernel arm64: fpsimd: Prevent registers leaking from dead tasks 2017-12-14 09:53:02 +01:00
kvm Fixes for interrupt controller emulation in ARM/ARM64 and x86, plus a one-liner 2017-11-04 11:44:55 -07:00
lib License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net bpf, arm64: implement jiting of BPF_J{LT, LE, SLT, SLE} 2017-08-09 16:53:56 -07:00
xen
Kconfig Merge branch 'arm64/vmap-stack' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux into for-next/core 2017-08-15 18:40:58 +01:00
Kconfig.debug
Kconfig.platforms ARM: arm64: Devicetree updates for v4.14 2017-09-10 20:54:48 -07:00
Makefile arm64: ftrace: emit ftrace-mod.o contents through code 2017-12-05 11:26:31 +01:00