Vulnerability · Published May 21, 2024 · Assigned by Linux
CVE-2023-52771cxl/port: Fix delete_endpoint() vs parent unregistration race
Medium 4.4
In plain English
A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 8% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: cxl/port: Fix delete_endpoint() vs parent unregistration race The CXL subsystem, at cxl_mem ->probe() time, establishes a lineage of ports (struct cxl_port objects) between an endpoint and the root of a CXL topology. Each port including the endpoint port is attached to the cxl_port driver. Given that setup, it follows that when either any port in that lineage goes through a cxl_port ->remove() event, or the memdev goes through a cxl_mem ->remove() event. The hierarchy below the removed port, or the entire hierarchy if the memdev is removed needs to come down. The delete_endpoint() callback is careful to check whether it is being called to tear down the hierarchy, or if it is only being called to teardown the memdev because an ancestor port is going through ->remove(). That care needs to take the device_lock() of the endpoint's parent. Which requires 2 bugs to be fixed: 1/ A reference on the parent is needed to prevent use-after-free scenarios like this signature: BUG: spinlock bad magic on CPU#0, kworker/u56:0/11 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20230524-3.fc38 05/24/2023 Workqueue: cxl_port detach_memdev [cxl_core] RIP: 0010:spin_bug+0x65/0xa0 Call Trace: do_raw_spin_lock+0x69/0xa0 __mutex_lock+0x695/0xb80 delete_endpoint+0xad/0x150 [cxl_core] devres_release_all+0xb8/0x110 device_unbind_cleanup+0xe/0x70 device_release_driver_internal+0x1d2/0x210 detach_memdev+0x15/0x20 [cxl_core] process_one_work+0x1e3/0x4c0 worker_thread+0x1dd/0x3d0 2/ In the case of RCH topologies, the parent device that needs to be locked is not always @port->dev as returned by cxl_mem_find_port(), use endpoint->dev.parent instead.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | bpftool | 7.3.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-debug-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-64k-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-abi-stablelists | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-cross-headers | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-debug-uki-virt | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-doc | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-headers | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-debug-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-rt-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-tools | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-tools-libs | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-tools-libs-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-uki-virt | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-devel | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-devel-matched | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-modules | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-modules-core | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | kernel-zfcpdump-modules-extra | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | libperf | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | perf | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | python3-perf | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | rtla | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| AlmaLinux:9 | rv | 5.14.0-427.33.1.el9_4 | ALSA-2024:5928 |
| Debian:12 | linux | no fix listed | DEBIAN-CVE-2023-52771 |
| Debian:13 | linux | 6.5.13-1 | DEBIAN-CVE-2023-52771 |
| Debian:14 | linux | 6.5.13-1 | DEBIAN-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | 6.5.0-1014.14 | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2023-52771 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2023-52771 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 8dd2bc0f8e02d39bd80851ca787bcbdb7d495e69 – before de0c4ff2fcaec149254b32f18b3ec806b312be748dd2bc0f8e02d39bd80851ca787bcbdb7d495e69 – before 37179fcc916bce8c3cc7b36d67ef814cce55142b8dd2bc0f8e02d39bd80851ca787bcbdb7d495e69 – before 6b2e428e673b3f55965674a426c40922e91388aa8dd2bc0f8e02d39bd80851ca787bcbdb7d495e69 – before 8d2ad999ca3c64cb08cf6a58d227b9d9e746d708 |
| Linux | Linux | 5.18 |