Skip to main content

CVE-2024-50226: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-50226cvecve-2024-50226
Published: Sat Nov 09 2024 (11/09/2024, 10:14:37 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

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.

AI-Powered Analysis

AILast updated: 07/02/2025, 23:28:01 UTC

Technical Analysis

CVE-2024-50226 is a high-severity use-after-free vulnerability in the Linux kernel's CXL (Compute Express Link) subsystem, specifically within the cxl/port driver component. The vulnerability arises from improper handling of out-of-order shutdown sequences of decoder objects in the CXL port topology. During the teardown of CXL regions, endpoint decoders are removed in an order that the driver did not originally anticipate, leading to a use-after-free condition. This occurs because the driver enforces in-order allocation and hardware enforces in-order commit, but the CXL specification does not mandate in-order shutdown. When a decoder is removed out-of-order, the cleanup process aborts prematurely, leaving dangling references to already freed decoder objects. Subsequent attempts to access these stale objects cause kernel crashes (general protection faults) and potentially compromise system stability and security. The fix involves modifying the driver to tolerate out-of-order shutdowns by always removing decoders regardless of order, converting certain failures into warnings to prevent kernel crashes, and adding a new reverse iteration mechanism to ensure proper cleanup of dependent decoders. This vulnerability is identified as CWE-416 (Use After Free) and has a CVSS 3.1 score of 7.8, indicating high severity. Exploitation requires local privileges with low complexity and no user interaction, but it can lead to full confidentiality, integrity, and availability compromise of the affected system. No known exploits are currently reported in the wild. The vulnerability affects specific Linux kernel versions identified by commit hashes, and it is relevant for systems utilizing CXL technology, which is increasingly used in high-performance computing and data center environments for memory and device interconnects.

Potential Impact

For European organizations, the impact of CVE-2024-50226 can be significant, especially those operating data centers, cloud infrastructure, or high-performance computing clusters running Linux kernels with CXL support. Exploitation of this vulnerability can lead to kernel crashes causing denial of service, potential privilege escalation, and arbitrary code execution within the kernel context. This compromises system confidentiality, integrity, and availability, potentially exposing sensitive data and disrupting critical services. Organizations relying on Linux-based servers with CXL-enabled hardware, such as advanced memory expansion or accelerator devices, are at risk. The vulnerability could be leveraged by malicious insiders or attackers who have gained limited local access to escalate privileges or cause persistent system outages. Given the increasing adoption of CXL in European data centers and research institutions, this vulnerability poses a tangible threat to operational continuity and data security. Additionally, the complexity of the fix and the specialized nature of CXL hardware mean that patching may require coordination with hardware vendors and kernel maintainers, potentially delaying remediation and increasing exposure time.

Mitigation Recommendations

To mitigate CVE-2024-50226, European organizations should: 1) Immediately identify and inventory Linux systems running kernel versions containing the vulnerable CXL driver commits. 2) Apply the official Linux kernel patches that address this vulnerability as soon as they become available from trusted sources or Linux distributions. 3) If patching is delayed, consider disabling CXL support temporarily on affected systems if feasible, to eliminate the attack surface. 4) Implement strict access controls and monitoring to limit local user privileges and detect anomalous behavior indicative of exploitation attempts. 5) Collaborate with hardware vendors to ensure firmware and driver compatibility with patched kernels, as CXL hardware interactions are critical. 6) Conduct thorough testing in staging environments to validate stability and performance post-patch, given the complexity of CXL interactions. 7) Maintain up-to-date incident response plans that include kernel-level vulnerabilities and ensure rapid response capabilities to kernel crashes or suspicious activity. 8) Educate system administrators and security teams about the specific nature of CXL vulnerabilities to improve detection and response.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-10-21T19:36:19.973Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9824c4522896dcbdf5bd

Added to database: 5/21/2025, 9:08:52 AM

Last enriched: 7/2/2025, 11:28:01 PM

Last updated: 7/30/2025, 3:35:34 AM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats