Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-50226 Overview
CVE-2024-50226 is a use-after-free vulnerability [CWE-416] in the Linux kernel's Compute Express Link (CXL) port subsystem. The flaw affects the cxl/port driver's handling of decoder shutdown sequences. When switch decoders are torn down out of order, the kernel aborts region cleanup while retaining references to freed decoder objects. Subsequent teardown attempts dereference the stale pointer, triggering a general protection fault. The vulnerability exists in Linux kernel 6.12 release candidates (rc1 through rc5) and earlier affected branches. Local attackers with low privileges can exploit this condition to achieve high-impact compromise of confidentiality, integrity, and availability.
Critical Impact
Local exploitation of this use-after-free in the CXL subsystem can lead to kernel memory corruption, denial of service through general protection faults, and potential local privilege escalation.
Affected Products
- Linux Kernel 6.12-rc1
- Linux Kernel 6.12-rc2 through 6.12-rc5
- Earlier Linux kernel branches containing the vulnerable cxl/port decoder teardown logic
Discovery Timeline
- 2024-11-09 - CVE-2024-50226 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-50226
Vulnerability Analysis
The vulnerability resides in the CXL port driver code responsible for tearing down endpoint and switch decoders associated with a CXL region. CXL regions aggregate multiple endpoint decoders that share common switch decoders in the topology. The teardown path invokes cxl_region_decode_reset() to disable decoders in the hierarchy.
The original implementation enforced strict in-order shutdown of switch decoders. When mock_decoder_reset encountered an out-of-order reset request, it aborted the operation. This left region3 intact while still referencing decoder14.0, which had already been scheduled for removal through cxld_unregister.
A second teardown attempt against the same region then dereferenced the stale decoder object. The call chain cxl_decoder_kill_region → cxl_region_detach → cxl_region_decode_reset → to_cxl_port operates on freed memory, producing the characteristic 0x6b6b6b6b6b6b6bc3 poison pattern in the fault address.
Root Cause
The root cause is an incorrect ordering assumption in the CXL driver. The CXL specification does not mandate in-order shutdown of switch decoders, yet the driver aborted teardown when decoders were released out of sequence. The abort left dangling references in port->commit_end and the region structure, creating the use-after-free window.
Attack Vector
Exploitation requires local access with low privileges on a system running an affected kernel. An attacker triggers CXL region creation and destruction operations through the CXL subsystem's device interfaces. By orchestrating teardown of endpoint decoders that share a common switch decoder, the attacker forces the out-of-order reset path and subsequent dereference of freed memory. The vulnerability requires no user interaction.
The upstream fix removes the in-order restriction, always completes decoder removal, converts cxl_region_invalidate_memregion() failures to warnings, and introduces device_for_each_child_reverse_from() to correctly decrement port->commit_end only after dependent decoders have been disabled.
Detection Methods for CVE-2024-50226
Indicators of Compromise
- Kernel log entries containing mock_decoder_reset out-of-order reset messages followed by cxl_region_decode_reset warnings
- General protection fault oops referencing to_cxl_port+0x8/0x60 [cxl_core] with non-canonical addresses matching the 0x6b6b6b6b slab poison pattern
- Unexpected cxld_unregister sequences in dmesg correlated with CXL region teardown operations
Detection Strategies
- Monitor kernel logs for CXL subsystem oops messages and call traces involving cxl_region_detach, cxl_decoder_kill_region, or cxl_region_decode_reset
- Audit running kernel versions against the patched commits to identify exposed hosts, specifically 101c268bd2f37e965a5468353e62d154db38838e, 78c8454fdce0eeee962be004eb6d99860c80dad1, and 8e1b52c15c81106456437f8e49575040e489e355
- Correlate crash telemetry with CXL device management activity performed by unprivileged users
Monitoring Recommendations
- Collect /var/log/kern.log, journalctl -k output, and kdump crash artifacts centrally for retrospective analysis
- Alert on repeated kernel panics or GPF events on systems with CXL hardware enabled
- Track unprivileged processes interacting with sysfs paths under /sys/bus/cxl/ and /sys/class/cxl/
How to Mitigate CVE-2024-50226
Immediate Actions Required
- Apply the upstream Linux kernel patches referenced in the vendor advisories to all systems running affected kernel versions
- Prioritize patching on hosts with CXL hardware enabled or kernels built with CXL support compiled in
- Restrict local access to systems pending patch deployment, since exploitation requires an authenticated local user
Patch Information
The vulnerability is resolved by three upstream commits merged into the Linux kernel stable tree. Administrators should rebuild and deploy kernels incorporating the fixes from Kernel Git Commit 101c268, Kernel Git Commit 78c8454, and Kernel Git Commit 8e1b52c. Distribution-specific kernel updates should be applied as vendors publish them.
Workarounds
- Disable the CXL subsystem by blacklisting cxl_core, cxl_port, cxl_mem, and related modules where CXL functionality is not required
- Restrict access to CXL sysfs management interfaces through filesystem permissions and mandatory access control policies
- Avoid loading cxl_test or similar test modules on production systems
# Blacklist CXL modules on systems that do not require CXL support
echo "blacklist cxl_core" | sudo tee /etc/modprobe.d/blacklist-cxl.conf
echo "blacklist cxl_port" | sudo tee -a /etc/modprobe.d/blacklist-cxl.conf
echo "blacklist cxl_mem" | sudo tee -a /etc/modprobe.d/blacklist-cxl.conf
sudo update-initramfs -u
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

