HIGH Introduced in 6.2
loongarch PhysmemEnd Corruption
CVE-2026-93237
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: LoongArch: Add DIRECT_MAP_PHYSMEM_END definition get_free_mem_region() and mhp_get_pluggable_range() bound their search to DIRECT_MAP_PHYSMEM_END. LoongArch does not define it, so the fallback in include/linux/mm.h applies: under CONFIG_SPARSEMEM_VMEMMAP it is (1ULL << MAX_PHYSMEM_BITS) - 1, a compile-time constant that does not adapt to the CPU's physical address space bits (cpu_pabits, probed from CPUCFG1). The vmemmap window only covers physical space below 2^(cpu_pabits+1) (i.e. VMEMMAP_SIZE), so on CPUs with fewer physical address bits than MAX_PHYSMEM_BITS the fallback allows get_free_mem_region() to return a ZONE_DEVICE region outside the vmemmap window; vmemmap_populate() then wraps the memmap range around and maps it into low memory, silently corrupting the page tables. The same search also picked the top-of- address-space region that crashed memmap_init_zone_device() with amdkfd on Loongson-3C6000 in 6.16 [1]; the commit 2969b42c8f99 ("LoongArch/mm: align vmemmap to maximal folio size") keeps that region in bounds on current Loongson-3C6000 configs, but CPUs with smaller cpu_pabits (e.g. the Loongson-2K series) are still affected. Define DIRECT_MAP_PHYSMEM_END as the vmemmap-covered physical range, (1ULL << (cpu_pabits + 1)) - 1, capped at (1ULL << MAX_PHYSMEM_BITS) - 1 under CONFIG_SPARSEMEM, similar to the commit f3336b48cf9d ("riscv: mm: Define DIRECT_MAP_PHYSMEM_END"). [1] https://lore.kernel.org/amd-gfx/20250814032153.227285-1-jeffbai@aosc.io/
02KernelScan AI Analysis
Risk summary
On LoongArch CPUs with fewer physical address bits than the compile-time maximum, the kernel can allocate device memory regions outside the valid vmemmap window, causing silent page table corruption and kernel crashes. This affects systems using ZONE_DEVICE memory such as those with GPU drivers. The risk is limited to specific LoongArch CPU variants like the Loongson-2K series.
Vulnerability analysis
On LoongArch systems, the kernel uses a fixed compile-time constant as the upper bound for physical memory instead of the CPU's actual physical address space size. On processors with fewer address bits than this constant, such as the Loongson-2K series, the kernel can select a device memory region outside the valid memory map window, causing the memory map population to wrap around and silently corrupt page tables in low memory. The fix defines the correct boundary based on the CPU's probed address width, preventing the search from returning out-of-bounds regions. This issue is reachable only on specific LoongArch CPU variants and is triggered through kernel operations that allocate device memory, such as GPU driver initialization.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 6.2 | 6.18.51 | ab275a23b4d9 |
| 7.2 | 6.2 | 7.2.5 | 55e18311c705 |
| mainline | 6.2 | 7.3 | 2677f97a67fd |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Affected — no CIP fix yet (latest 6.12.112-cip33) |