CVE-2023-52849
cxl/mem: Fix shutdown order
Check your servers for CVE-2023-52849
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-52849 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
cxl/mem: Fix shutdown order
Ira reports that removing cxl_mock_mem causes a crash with the following trace:
BUG: kernel NULL pointer dereference, address: 0000000000000044 [..] RIP: 0010:cxl_region_decode_reset+0x7f/0x180 [cxl_core] [..] Call Trace: <TASK> cxl_region_detach+0xe8/0x210 [cxl_core] cxl_decoder_kill_region+0x27/0x40 [cxl_core] cxld_unregister+0x29/0x40 [cxl_core] devres_release_all+0xb8/0x110 device_unbind_cleanup+0xe/0x70 device_release_driver_internal+0x1d2/0x210 bus_remove_device+0xd7/0x150 device_del+0x155/0x3e0 device_unregister+0x13/0x60 devm_release_action+0x4d/0x90 ? __pfx_unregister_port+0x10/0x10 [cxl_core] delete_endpoint+0x121/0x130 [cxl_core] devres_release_all+0xb8/0x110 device_unbind_cleanup+0xe/0x70 device_release_driver_internal+0x1d2/0x210 bus_remove_device+0xd7/0x150 device_del+0x155/0x3e0 ? lock_release+0x142/0x290 cdev_device_del+0x15/0x50 cxl_memdev_unregister+0x54/0x70 [cxl_core]
This crash is due to the clearing out the cxl_memdev's driver context (@cxlds) before the subsystem is done with it. This is ultimately due to the region(s), that this memdev is a member, being torn down and expecting to be able to de-reference @cxlds, like here:
static int cxl_region_decode_reset(struct cxl_region *cxlr, int count) ... if (cxlds->rcd) goto endpoint_reset; ...
Fix it by keeping the driver context valid until memdev-device unregistration, and subsequently the entire stack of related dependencies, unwinds.
Exploitation
EPSS 0.24%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 15.5% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 10 Jun 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 9cc238c7a526dba9ee8c210fa2828886fc65db66, before 20bd0198bebdd706bd4614b3933ef70d7c19618f affected from 9cc238c7a526dba9ee8c210fa2828886fc65db66, before 7c7371b41a14e86f53e7dbe5baa7b1d3e0ab324b affected from 9cc238c7a526dba9ee8c210fa2828886fc65db66, before cad22a757029c3a1985c221a2d4a6491ad4035ae affected from 9cc238c7a526dba9ee8c210fa2828886fc65db66, before 0ca074f7d788627a4e0b047ca5fbdb5fc567220c affected from 9cc238c7a526dba9ee8c210fa2828886fc65db66, before 88d3917f82ed4215a2154432c26de1480a61b209 affected 964a9834492210f48b360baa9e20a9eedf4d08ff affected from 5.14.8, before 5.15
Other versions: unaffected
|
| Linux |
affected 5.15 unaffected before 5.15 unaffected from 5.15.139 up to and including 5.15.* unaffected from 6.1.63 up to and including 6.1.* unaffected from 6.5.12 up to and including 6.5.* unaffected from 6.6.2 up to and including 6.6.* unaffected 6.7 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2023-52849 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2023-52849
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2023-52849
trivy image --scanners vuln IMAGE | grep CVE-2023-52849
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/20bd0198bebdd706bd4614b3933ef70d7c19618f git.kernel.org
- https://git.kernel.org/stable/c/7c7371b41a14e86f53e7dbe5baa7b1d3e0ab324b git.kernel.org
- https://git.kernel.org/stable/c/cad22a757029c3a1985c221a2d4a6491ad4035ae git.kernel.org
- https://git.kernel.org/stable/c/0ca074f7d788627a4e0b047ca5fbdb5fc567220c git.kernel.org
- https://git.kernel.org/stable/c/88d3917f82ed4215a2154432c26de1480a61b209 git.kernel.org
Source: the record CVE-2023-52849 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse