linux-stable/arch/arm64/mm
Steve Capper ec89ab50a0 arm64: Fix TTBR + PAN + 52-bit PA logic in cpu_do_switch_mm
In cpu_do_switch_mm(.) with ARM64_SW_TTBR0_PAN=y we apply phys_to_ttbr
to a value that already has an ASID inserted into the upper bits. For
52-bit PA configurations this then can give us TTBR0_EL1 registers that
cause translation table walks to attempt to access non-zero PA[51:48]
spuriously. Ultimately leading to a Synchronous External Abort on level
1 translation.

This patch re-arranges the logic in cpu_do_switch_mm(.) such that
phys_to_ttbr is called before the ASID is inserted into the TTBR0 value.

Fixes: 6b88a32c7a ("arm64: kpti: Fix the interaction between ASID switching and software PAN")
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Tested-by: Kristina Martsenko <kristina.martsenko@arm.com>
Reviewed-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2018-01-26 18:23:17 +00:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache.S arm64: kpti: Fix the interaction between ASID switching and software PAN 2018-01-16 17:37:48 +00:00
context.c arm64: Move BP hardening to check_and_switch_context 2018-01-23 15:40:29 +00:00
copypage.c arm64: Defer dcache flush in __cpu_copy_user_page 2015-12-17 11:07:13 +00:00
dma-mapping.c dma mapping : export caller to vmallocinfo 2017-10-04 13:43:00 +01:00
dump.c arm64: dump: Add checking for writable and exectuable pages 2016-11-07 18:15:04 +00:00
extable.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fault.c arm64: Add skeleton to harden the branch predictor against aliasing attacks 2018-01-08 18:45:25 +00:00
flush.c arm64: fix pmem interface definition 2017-08-10 18:13:59 +01:00
hugetlbpage.c arm64: hugetlb: Cleanup setup_hugepagesz 2017-08-22 17:47:12 +01:00
init.c arm64: mm: ignore memory above supported physical address size 2018-01-19 13:09:40 +00:00
ioremap.c arm64: use is_vmalloc_addr 2017-02-09 13:47:56 +00:00
kasan_init.c arm64/mm/kasan: don't use vmemmap_populate() to initialize shadow 2017-11-15 18:21:05 -08:00
mmap.c arm64/mmap: properly account for stack randomization in mmap_base 2017-07-12 16:26:03 -07:00
mmu.c arm64: Extend early page table code to allow for larger kernels 2018-01-14 18:49:52 +00:00
numa.c arm64/numa: Drop duplicate message 2017-07-20 17:03:53 +01:00
pageattr.c arm64: use set_memory.h header 2017-05-08 17:15:13 -07:00
pgd.c arm64: handle 52-bit addresses in TTBR 2017-12-22 17:35:21 +00:00
physaddr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.S arm64: Fix TTBR + PAN + 52-bit PA logic in cpu_do_switch_mm 2018-01-26 18:23:17 +00:00
ptdump_debugfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00