The vulnerability in find_num_contig (called by huge_ptep_get) is a latent architectural dependency masquerading as a simple alignment bug. The function incorrectly returns CONT_PTES instead of CONT_PMDS when calculating iteration bounds for unaligned huge page addresses. On 4K-page arm64 systems, this is harmless because CONT_PTES equals CONT_PMDS. On 16K-page systems, this equality breaks—and the same unaligned input that was benign suddenly causes the function to iterate past the PTE table boundary and dereference a garbage linear map address. The dereferenced pointer is a kernel linear map address, meaning the code can access physical memory outside the kernel's managed region, potentially corrupting unrelated data structures, or hit an unmapped virtual address and panic. This is not theoretical—it is a direct memory access violation triggered by a deterministic input condition.
The callers (pagemap_hugetlb_range, page_mapped_in_vma) are used in core memory management interfaces, not obscure paths. The critical question is whether unaligned addresses to hugetlb folios are actually reachable through these paths in normal kernel operation. If they are, this vulnerability may have been silently triggering kernel panics on 16K arm64 configurations for years without anyone connecting the crashes to their root cause.
For defenders: audit your 16K arm64 kernel panic logs for patterns pointing to huge_ptep_get or find_num_contig as the faulting function—this CVE may explain previously unexplained crashes. Review whether your environment exercises hugetlb paths with misaligned addresses. The patch aligns the pmdp pointer before comparison, which is correct—but the deeper exposure is that the kernel's page table abstraction does not enforce or validate these invariants across configurations. A compile-time assertion validating CONT_PTES == CONT_PMDS when it matters would catch similar bugs earlier.