CVE: CVE-2023-53706
Published: 2025-10-22
Description: In the Linux kernel, the following vulnerability has been resolved:

mm/vmemmap/devdax: fix kernel crash when probing devdax devices

commit 4917f55b4ef9 ("mm/sparse-vmemmap: improve memory savings for
compound devmaps") added support for using optimized vmmemap for devdax
devices.  But how vmemmap mappings are created are architecture specific. 
For example, powerpc with hash translation doesn't have vmemmap mappings
in init_mm page table instead they are bolted table entries in the
hardware page table

vmemmap_populate_compound_pages() used by vmemmap optimization code is not
aware of these architecture-specific mapping.  Hence allow architecture to
opt for this feature.  I selected architectures supporting
HUGETLB_PAGE_OPTIMIZE_VMEMMAP option as also supporting this feature.

This patch fixes the below crash on ppc64.

BUG: Unable to handle kernel data access on write at 0xc00c[PII_REDACTED]38
Faulting instruction address: 0xc[PII_REDACTED]69d90
Oops: Kernel access of bad area, sig: 11 [#1]
LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
Modules linked in:
CPU: 7 PID: 1 Comm: swapper/0 Not tainted 6.3.0-rc5-150500.34-default+ #2 5c90a668b6bbd[PII_REDACTED]5c2fb5de19d7d28a
Hardware name: IBM,9009-42G POWER9 (raw) 0x4e0202 0xf000005 of:IBM,FW950.40 (VL950_099) hv:phyp pSeries
NIP:  c[PII_REDACTED]69d90 LR: c[PII_REDACTED]c57d4 CTR: [PII_REDACTED]
REGS: c[PII_REDACTED]32c30 TRAP: 0300   Not tainted  (6.3.0-rc5-150500.34-default+)
MSR:  [PII_REDACTED] <SF,EE,ME,IR,DR,RI,LE>  CR: 24842228  XER: 00000000
CFAR: c[PII_REDACTED]c57d0 DAR: c00c[PII_REDACTED]38 DSISR: 42000000 IRQMASK: 0
....
NIP [c[PII_REDACTED]69d90] __init_single_page.isra.74+0x14/0x4c
LR [c[PII_REDACTED]c57d4] __init_zone_device_page+0x44/0xd0
Call Trace:
[c[PII_REDACTED]32ed0] [c[PII_REDACTED]32f60] 0xc[PII_REDACTED]32f60 (unreliable)
[c[PII_REDACTED]32f10] [c[PII_REDACTED]c5ca0] memmap_init_zone_device+0x170/0x250
[c[PII_REDACTED]32fe0] [c[PII_REDACTED]575f8] memremap_pages+0x2c8/0x7f0
[c[PII_REDACTED]330c0] [c[PII_REDACTED]57b5c] devm_memremap_pages+0x3c/0xa0
[c[PII_REDACTED]33100] [c000000000d458a8] dev_dax_probe+0x108/0x3e0
[c[PII_REDACTED]331a0] [c000000000d41430] dax_bus_probe+0xb0/0x140
[c[PII_REDACTED]331d0] [c000000000cef27c] really_probe+0x19c/0x520
[c[PII_REDACTED]33260] [c000000000cef6b4] __driver_probe_device+0xb4/0x230
[c[PII_REDACTED]332e0] [c000000000cef888] driver_probe_device+0x58/0x120
[c[PII_REDACTED]33320] [c000000000cefa6c] __device_attach_driver+0x11c/0x1e0
[c[PII_REDACTED]333a0] [c000000000cebc58] bus_for_each_drv+0xa8/0x130
[c[PII_REDACTED]33400] [c000000000ceefcc] __device_attach+0x15c/0x250
[c[PII_REDACTED]334a0] [c000000000ced458] bus_probe_device+0x108/0x110
[c[PII_REDACTED]334f0] [c000000000ce92dc] device_add+0x7fc/0xa10
[c[PII_REDACTED]335b0] [c000000000d447c8] devm_create_dev_dax+0x1d8/0x530
[c[PII_REDACTED]33640] [c000000000d46b60] __dax_pmem_probe+0x200/0x270
[c[PII_REDACTED]337b0] [c000000000d46bf0] dax_pmem_probe+0x20/0x70
[c[PII_REDACTED]337d0] [c000000000d2279c] nvdimm_bus_probe+0xac/0x2b0
[c[PII_REDACTED]33860] [c000000000cef27c] really_probe+0x19c/0x520
[c[PII_REDACTED]338f0] [c000000000cef6b4] __driver_probe_device+0xb4/0x230
[c[PII_REDACTED]33970] [c000000000cef888] driver_probe_device+0x58/0x120
[c[PII_REDACTED]339b0] [c000000000cefd08] __driver_attach+0x1d8/0x240
[c[PII_REDACTED]33a30] [c000000000cebb04] bus_for_each_dev+0xb4/0x130
[c[PII_REDACTED]33a90] [c000000000cee564] driver_attach+0x34/0x50
[c[PII_REDACTED]33ab0] [c000000000ced878] bus_add_driver+0x218/0x300
[c[PII_REDACTED]33b40] [c000000000cf1144] driver_register+0xa4/0x1b0
[c[PII_REDACTED]33bb0] [c000000000d21a0c] __nd_driver_register+0x5c/0x100
[c[PII_REDACTED]33c10] [c[PII_REDACTED]6a2e8] dax_pmem_init+0x34/0x48
[c[PII_REDACTED]33c30] [c[PII_REDACTED]132d0] do_one_initcall+0x60/0x320
[c[PII_REDACTED]33d00] [c[PII_REDACTED]051b0] kernel_init_freeable+0x360/0x400
[c[PII_REDACTED]33de0] [c[PII_REDACTED]13764] kernel_init+0x34/0x1d0
[c[PII_REDACTED]33e50] [c[PII_REDACTED]0de14] ret_from_kernel_thread+0x5c/0x64
References: https://git.kernel.org/stable/c/87a7ae75d7383afa998f57656d1d14e2a730cc47; https://git.kernel.org/stable/c/8f4603588acf5807aa1f1b4b1ea2b0365acd71f0