arm64: mm: Fix a TLBI operand and a TTBR1 write in the KPTI nG rewrite
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | arm64: mm: Mask the TLBI operand in kpti_map_pgtbl()arch/ | +1 | 0 replies | |
| 2/2 | arm64: mm: Convert the temporary KPTI pgd address for TTBR1_EL1arch/ | +1 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Ard Biesheuvel |
|---|---|
| Series | R-b |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] arm64: mm: Fix a TLBI operand and a TTBR1 write in the KPTI nG rewrite
Hi folks,
This series fixes a TLBI operand and a TTBR1_EL1 write in idmap_kpti_install_ng_mappings(). Both came up while I was working on the ISB fix to the same code [1].
The first masks the TLBI operand in kpti_map_pgtbl(). Its upper bits hold a wrong TTL hint on 4K and 16K kernels, which can leave kernel mappings global. I couldn't find a CPU with FEAT_TTL that requires KPTI, so hitting this takes kpti=on. The Falkor workaround in tramp_map_kernel has the same unmasked operand. I left it alone, as AFAICT the CPUs with that erratum predate FEAT_TTL.
The second converts the temporary pgd's address before writing it to TTBR1_EL1, which changes the value only for tables above 2^48 on a 52-bit PA kernel.
Both bugs were introduced by commit 47546a1912fc4 ("arm64: mm: install KPTI nG mappings with MMU enabled"). I left out the Fixes: tags, as I don't think either is worth a backport.
Tested on QEMU (4K, and 64K with 52-bit PA) and on FVP, with "nokaslr kpti=on". The second bug reproduces on QEMU with RAM placed at 2^48. Without the patch the boot hangs, and with it the kernel boots. I couldn't reproduce the first, as QEMU ignores the TTL hint and on FVP the patch doesn't change which mappings end up global.
Based on Linux 7.4-rc1 (6628e7d4c6b25; also applies to arm64 for-next/fixes a7e632493acf3).
Cheers,
/fuad
[1] https://lore.kernel.org/all/[email protected]/
Fuad Tabba (2):
arm64: mm: Mask the TLBI operand in kpti_map_pgtbl()
arm64: mm: Convert the temporary KPTI pgd address for TTBR1_EL1
arch/arm64/mm/proc.S | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
Signature · 1 line
2.47.3