linux-yocto/arch/arm64/mm
Dev Jain 47f34289d1 arm64: Restrict pagetable teardown to avoid false warning
commit 650768c512 upstream.

Commit 9c006972c3 ("arm64: mmu: drop pXd_present() checks from
pXd_free_pYd_table()") removes the pxd_present() checks because the
caller checks pxd_present(). But, in case of vmap_try_huge_pud(), the
caller only checks pud_present(); pud_free_pmd_page() recurses on each
pmd through pmd_free_pte_page(), wherein the pmd may be none. Thus it is
possible to hit a warning in the latter, since pmd_none => !pmd_table().
Thus, add a pmd_present() check in pud_free_pmd_page().

This problem was found by code inspection.

Fixes: 9c006972c3 ("arm64: mmu: drop pXd_present() checks from pXd_free_pYd_table()")
Cc: stable@vger.kernel.org
Reported-by: Ryan Roberts <ryan.roberts@arm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Link: https://lore.kernel.org/r/20250527082633.61073-1-dev.jain@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:11:39 +01:00
..
cache.S
context.c arm64: Ensure bits ASID[15:8] are masked out when the kernel uses 8-bit ASIDs 2024-12-14 20:03:22 +01:00
contpte.c mm: arm64: document why pte is not advanced in contpte_ptep_set_access_flags() 2024-09-06 12:28:33 +01:00
copypage.c arm64: Also reset KASAN tag if page is not PG_mte_tagged 2023-05-16 14:58:54 +01:00
dma-mapping.c arm64: Properly clean up iommu-dma remnants 2024-05-10 09:04:25 +02:00
extable.c
fault.c arm64: handle PKEY/POE faults 2024-09-04 12:53:44 +01:00
fixmap.c - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
flush.c arm64: implement the new page table range API 2023-08-24 16:20:20 -07:00
hugetlbpage.c arm64: hugetlb: Fix huge_ptep_get_and_clear() for non-present ptes 2025-03-13 13:02:17 +01:00
init.c arm64/mm: Fix Boot panic on Ampere Altra 2025-03-07 18:25:39 +01:00
ioremap.c arm64: mm: Add confidential computing hook to ioremap_prot() 2024-08-30 16:30:41 +01:00
kasan_init.c - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
Makefile arm64: mm: Add top-level dispatcher for internal mem_encrypt API 2024-08-30 16:30:41 +01: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: convert protection key into vm_flags and pgprot values 2024-09-04 12:52:41 +01:00
mmu.c arm64: Restrict pagetable teardown to avoid false warning 2025-06-27 11:11:39 +01:00
mteswap.c arm64: mm: swap: support THP_SWAP on hardware with MTE 2024-04-25 20:56:07 -07:00
pageattr.c arm64: hibernate: Fix level3 translation fault in swsusp_save() 2024-04-19 16:33:00 +01:00
pgd.c arm64: mm: Add support for folding PUDs at runtime 2024-02-16 12:42:41 +00:00
physaddr.c
proc.S arm64/mm: Drop TCR_SMP_FLAGS 2024-08-16 11:24:55 +01:00
ptdump_debugfs.c
ptdump.c arm64: ptdump: Don't override the level when operating on the stage-2 tables 2024-09-10 21:32:51 +01:00
trans_pgd-asm.S
trans_pgd.c arm64: trans_pgd: mark PTEs entries as valid to avoid dead kexec() 2024-09-04 16:30:23 +01:00