linux/arch/arm64/mm
Karl Mehltretter a77644d009 arm64: mm: Fix the lockless page-table walk in show_pte()
show_pte() walks page tables locklessly and can run with interrupts
enabled. A concurrent teardown can free a table page while it is being
walked. It can also clear a parent entry after show_pte() checked it; the
regular pXd_offset() helpers then reread the cleared entry and can derive a
bogus lower-level pointer and fault again.

Use the lockless offset helpers with the saved parent entries, as
gup_fast() does, and pass the saved PMD to pte_offset_map().

For task page tables, arm64 selects MMU_GATHER_RCU_TABLE_FREE. Disable
local interrupts around the walk to hold off RCU-deferred table frees and
block the tlb_remove_table_sync_one() IPI until the walk is finished.

Place the IRQ guard after the header print. This does not make the output a
consistent snapshot, but prevents the task page-table walk from
dereferencing a released table page or deriving a pointer from a different
parent value.

Fixes: 1d18c47c73 ("arm64: MMU fault handling and page table management")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Will Deacon <will@kernel.org>
2026-09-03 12:58:12 +00:00
..
cache.S arm64: Provide dcache_inval_poc_nosync helper 2026-03-13 23:47:16 +01:00
context.c arm64/mm: Directly use TTBRx_EL1_CnP 2026-03-14 16:12:27 +00:00
contpte.c arm64: cpufeature: Rename BBML2_NOABORT as BBML3 2026-08-06 12:15:30 +00:00
copypage.c arm64: mte: Do not warn if the page is already tagged in copy_highpage() 2025-10-23 17:34:58 +01:00
dma-mapping.c arm64: mm: Treat all devices as dma-coherent when CLIDR_EL1.LoC == 0 2026-08-02 09:16:39 +00:00
extable.c arm64: mm: Handle PAN faults on uaccess CPY* instructions 2025-03-07 18:28:29 +00:00
fault.c arm64: mm: Fix the lockless page-table walk in show_pte() 2026-09-03 12:58:12 +00:00
fixmap.c arm64: Rename page table BSS section to .bss..pgtbl 2026-06-05 11:44:09 +01:00
flush.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
gcs.c arm64: gcs: use the new common vm_mmap_shadow_stack() helper 2026-04-05 13:53:05 -07:00
hugetlbpage.c arm64: make huge_ptep_get handled unaligned addresses 2026-07-22 11:44:47 +00:00
init.c dma-mapping updates for Linux 7.3: 2026-08-24 11:35:46 -07:00
ioremap.c arm64: io: Rename ioremap_prot() to __ioremap_prot() 2026-02-25 19:49:51 +00:00
kasan_init.c arm64: mm: remove unreachable invalid range check in kasan_init_shadow() 2026-07-01 09:22:40 +03:00
Makefile mm: rename GENERIC_PTDUMP and PTDUMP_CORE 2025-03-17 00:05:32 -07:00
mem_encrypt.c arm64: mm: Add top-level dispatcher for internal mem_encrypt API 2024-08-30 16:30:41 +01:00
mmap.c arm64/mm: Rename ptdesc_t 2026-06-05 11:44:36 +01:00
mmu.c arm64 updates for 7.3 2026-08-18 11:57:17 -07:00
mteswap.c arm64: mm: swap: support THP_SWAP on hardware with MTE 2024-04-25 20:56:07 -07:00
pageattr.c arm64/mm: Rename ptdesc_t 2026-06-05 11:44:36 +01:00
pgd.c arm64/mm: Ensure PGD_SIZE is aligned to 64 bytes when PA_BITS = 52 2025-11-11 19:13:03 +00:00
physaddr.c arm64: mm: Don't use %pK through printk 2025-03-20 15:34:53 +00:00
proc.S Merge branch 'for-next/nmi' into for-next/core 2026-08-14 10:16:10 +00:00
ptdump_debugfs.c mm/ptdump: take the memory hotplug lock inside ptdump_walk_pgd() 2025-07-09 22:42:20 -07:00
ptdump.c arm64 fixes for -rc1 2026-08-28 09:02:04 -07:00
trans_pgd-asm.S arm64: kexec: configure EL2 vectors for kexec 2021-10-01 13:31:00 +01:00
trans_pgd.c arm64: mm: Handle invalid large leaf mappings correctly 2026-04-02 20:49:16 +01:00