diff options
author | Will Deacon <will@kernel.org> | 2020-03-18 21:38:29 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-03-19 09:28:43 +0100 |
commit | c83557859eaa1286330a4d3d2e1ea0c0988c4604 (patch) | |
tree | 71ae1a4d4b85e5f6d6494a62ce2b8e94dcb932dc /MAINTAINERS | |
parent | arm64: smp: fix crash_smp_send_stop() behaviour (diff) | |
download | linux-c83557859eaa1286330a4d3d2e1ea0c0988c4604.tar.xz linux-c83557859eaa1286330a4d3d2e1ea0c0988c4604.zip |
arm64: kpti: Fix "kpti=off" when KASLR is enabled
Enabling KASLR forces the use of non-global page-table entries for kernel
mappings, as this is a decision that we have to make very early on before
mapping the kernel proper. When used in conjunction with the "kpti=off"
command-line option, it is possible to use non-global kernel mappings but
with the kpti trampoline disabled.
Since commit 09e3c22a86f6 ("arm64: Use a variable to store non-global
mappings decision"), arm64_kernel_unmapped_at_el0() reflects only the use of
non-global mappings and does not take into account whether the kpti
trampoline is enabled. This breaks context switching of the TPIDRRO_EL0
register for 64-bit tasks, where the clearing of the register is deferred to
the ret-to-user code, but it also breaks the ARM SPE PMU driver which
helpfully recommends passing "kpti=off" on the command line!
Report whether or not KPTI is actually enabled in
arm64_kernel_unmapped_at_el0() and check the 'arm64_use_ng_mappings' global
variable directly when determining the protection flags for kernel mappings.
Cc: Mark Brown <broonie@kernel.org>
Reported-by: Hongbo Yao <yaohongbo@huawei.com>
Tested-by: Hongbo Yao <yaohongbo@huawei.com>
Fixes: 09e3c22a86f6 ("arm64: Use a variable to store non-global mappings decision")
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'MAINTAINERS')
0 files changed, 0 insertions, 0 deletions