Vulnerability · Published Nov 9, 2024 · Assigned by Linux

CVE-2024-50226cxl/port: Fix use-after-free, permit out-of-order decoder shutdown

High 7.8

In plain English

A high-severity use-after-free 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 15% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.2%top 84.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: cxl/port: Fix use-after-free, permit out-of-order decoder shutdown In support of investigating an initialization failure report [1], cxl_test was updated to register mock memory-devices after the mock root-port/bus device had been registered. That led to cxl_test crashing with a use-after-free bug with the following signature: cxl_port_attach_region: cxl region3: cxl_host_bridge.0:port3 decoder3.0 add: mem0:decoder7.0 @ 0 next: cxl_switch_uport.0 nr_eps: 1 nr_targets: 1 cxl_port_attach_region: cxl region3: cxl_host_bridge.0:port3 decoder3.0 add: mem4:decoder14.0 @ 1 next: cxl_switch_uport.0 nr_eps: 2 nr_targets: 1 cxl_port_setup_targets: cxl region3: cxl_switch_uport.0:port6 target[0] = cxl_switch_dport.0 for mem0:decoder7.0 @ 0 1) cxl_port_setup_targets: cxl region3: cxl_switch_uport.0:port6 target[1] = cxl_switch_dport.4 for mem4:decoder14.0 @ 1 [..] cxld_unregister: cxl decoder14.0: cxl_region_decode_reset: cxl_region region3: mock_decoder_reset: cxl_port port3: decoder3.0 reset 2) mock_decoder_reset: cxl_port port3: decoder3.0: out of order reset, expected decoder3.1 cxl_endpoint_decoder_release: cxl decoder14.0: [..] cxld_unregister: cxl decoder7.0: 3) cxl_region_decode_reset: cxl_region region3: Oops: general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6bc3: 0000 [#1] PREEMPT SMP PTI [..] RIP: 0010:to_cxl_port+0x8/0x60 [cxl_core] [..] Call Trace: <TASK> cxl_region_decode_reset+0x69/0x190 [cxl_core] cxl_region_detach+0xe8/0x210 [cxl_core] cxl_decoder_kill_region+0x27/0x40 [cxl_core] cxld_unregister+0x5d/0x60 [cxl_core] At 1) a region has been established with 2 endpoint decoders (7.0 and 14.0). Those endpoints share a common switch-decoder in the topology (3.0). At teardown, 2), decoder14.0 is the first to be removed and hits the "out of order reset case" in the switch decoder. The effect though is that region3 cleanup is aborted leaving it in-tact and referencing decoder14.0. At 3) the second attempt to teardown region3 trips over the stale decoder14.0 object which has long since been deleted. The fix here is to recognize that the CXL specification places no mandate on in-order shutdown of switch-decoders, the driver enforces in-order allocation, and hardware enforces in-order commit. So, rather than fail and leave objects dangling, always remove them. In support of making cxl_region_decode_reset() always succeed, cxl_region_invalidate_memregion() failures are turned into warnings. Crashing the kernel is ok there since system integrity is at risk if caches cannot be managed around physical address mutation events like CXL region destruction. A new device_for_each_child_reverse_from() is added to cleanup port->commit_end after all dependent decoders have been disabled. In other words if decoders are allocated 0->1->2 and disabled 1->2->0 then port->commit_end only decrements from 2 after 2 has been disabled, and it decrements all the way to zero since 1 was disabled previously.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:9bpftool7.4.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-debug5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-debug-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-debug-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-debug-devel-matched5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-debug-modules5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-debug-modules-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-debug-modules-extra5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-devel-matched5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-modules5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-modules-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-64k-modules-extra5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-abi-stablelists5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-cross-headers5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug-devel-matched5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug-modules5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug-modules-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug-modules-extra5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-debug-uki-virt5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-devel-matched5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-doc5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-headers5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-modules5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-modules-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-modules-extra5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-debug5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-debug-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-debug-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-debug-modules5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-debug-modules-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-debug-modules-extra5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-modules5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-modules-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-rt-modules-extra5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-tools5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-tools-libs5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-tools-libs-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-uki-virt5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-uki-virt-addons5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-zfcpdump5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-zfcpdump-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-zfcpdump-devel5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-zfcpdump-devel-matched5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-zfcpdump-modules5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-zfcpdump-modules-core5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9kernel-zfcpdump-modules-extra5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9libperf5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9perf5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9python3-perf5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9rtla5.14.0-503.15.1.el9_5ALSA-2024:10274
AlmaLinux:9rv5.14.0-503.15.1.el9_5ALSA-2024:10274
Debian:12linuxno fix listedDEBIAN-CVE-2024-50226
Debian:13linux6.11.7-1DEBIAN-CVE-2024-50226
Debian:14linux6.11.7-1DEBIAN-CVE-2024-50226
Ubuntu:24.04:LTSlinux6.8.0-58.60UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-aws6.8.0-1027.29UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1027.29~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-azure6.8.0-1027.32UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-azure-6.116.11.0-1012.12~24.04.1UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1027.32~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-azure-nvidia6.8.0-1014.15UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-gcp6.8.0-1028.30UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-gcp-6.116.11.0-1011.11~24.04.1UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1028.30~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-gke6.8.0-1023.27UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1010.12UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-58.60~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-ibm6.8.0-1024.24UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1024.24~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-58.60.1UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-58.60.1~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1026.29UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-nvidia-6.116.11.0-1007.7UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1026.29~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1026.29.1UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-nvidia-tegra6.8.0-1008.8UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1015.15UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1026.26UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-oracle6.8.0-1024.25UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1024.25~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-raspi6.8.0-1028.32UBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-riscv6.8.0-58.60.1UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-58.60.1~22.04.1UBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-50226
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-50226
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1017.18UBUNTU-CVE-2024-50226

Affected products (as reported)

VendorProductVersions
Linux Linux 176baefb2eb5d7a3ddebe3ff803db1fce44574b5 – before 3ecd2b229f5e42b36b5acf0e82510a70a632f041176baefb2eb5d7a3ddebe3ff803db1fce44574b5 – before 8e1b52c15c81106456437f8e49575040e489e355176baefb2eb5d7a3ddebe3ff803db1fce44574b5 – before 78c8454fdce0eeee962be004eb6d99860c80dad1176baefb2eb5d7a3ddebe3ff803db1fce44574b5 – before 101c268bd2f37e965a5468353e62d154db38838e
Linux Linux 6.0

Weakness: CWE-416 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References