CVE-2023-54323: cxl/pmem: Fix nvdimm registration races
In the Linux kernel, the following vulnerability has been resolved:
cxl/pmem: Fix nvdimm registration races
A loop of the form:
while true; do modprobe cxlpci; modprobe -r cxlpci; done
...fails with the following crash signature:
BUG: kernel NULL pointer dereference, address: 0000000000000040 [..] RIP: 0010:cxlinternalsendcmd+0x5/0xb0 [cxlcore] [..] Call Trace: <TASK> cxlpmemctl+0x121/0x240 [cxlpmem] nvdimmgetconfigdata+0xd6/0x1a0 [libnvdimm] ndlabeldatainit+0x135/0x7e0 [libnvdimm] nvdimmprobe+0xd6/0x1c0 [libnvdimm] nvdimmbusprobe+0x7a/0x1e0 [libnvdimm] reallyprobe+0xde/0x380 driverprobedevice+0x78/0x170 driverprobedevice+0x1f/0x90 deviceattachdriver+0x85/0x110 busforeachdrv+0x7d/0xc0 deviceattach+0xb4/0x1e0 busprobedevice+0x9f/0xc0 deviceadd+0x445/0x9c0 ndasyncdeviceregister+0xe/0x40 [libnvdimm] asyncrunentryfn+0x30/0x130
...namely that the bottom half of async nvdimm device registration runs after the CXL has already torn down the context that cxlpmemctl() needs. Unlike the ACPI NFIT case that benefits from launching multiple nvdimm device registrations in parallel from those listed in the table, CXL is already marked PROBEPREFERASYNCHRONOUS. So provide for a synchronous registration path to preclude this scenario.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2023-54323?
CVE-2023-54323 has been classified as a high severity vulnerability due to its potential to cause kernel crashes.
How do I fix CVE-2023-54323?
To fix CVE-2023-54323, update your Linux kernel to the latest version where this vulnerability has been resolved.
What systems are affected by CVE-2023-54323?
CVE-2023-54323 affects various versions of the Linux kernel that utilize the cxl/pmem functionality.
What are the symptoms of the vulnerability CVE-2023-54323?
The symptoms of CVE-2023-54323 include kernel crashes indicated by a NULL pointer dereference error when loading specific modules.
Is there a workaround for CVE-2023-54323 until I can apply a fix?
As a temporary workaround for CVE-2023-54323, avoid using the modprobe command on the cxl_pci module repeatedly.