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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-11-09T10:14:37.003Z
- **Modified:** 2026-10-30T13:17:40.710Z

## Who should check

- Anyone running Linux \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 3ecd2b229f5e42b36b5acf0e82510a70a632f041; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 8e1b52c15c81106456437f8e49575040e489e355; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 78c8454fdce0eeee962be004eb6d99860c80dad1; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 101c268bd2f37e965a5468353e62d154db38838e
- Anyone running Linux 6.0

## 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 and fixed versions

- Linux: \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 3ecd2b229f5e42b36b5acf0e82510a70a632f041; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 8e1b52c15c81106456437f8e49575040e489e355; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 78c8454fdce0eeee962be004eb6d99860c80dad1; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 101c268bd2f37e965a5468353e62d154db38838e (cvelist)
- Linux: 6.0 (cvelist)

## Mitigation

- Upgrade Linux to 101c268bd2f37e965a5468353e62d154db38838e or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-50226. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-50226.md
Affected: Linux >= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, < 3ecd2b229f5e42b36b5acf0e82510a70a632f041; >= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, < 8e1b52c15c81106456437f8e49575040e489e355; >= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, < 78c8454fdce0eeee962be004eb6d99860c80dad1; >= 176baefb2eb5d7a3ddebe3f…
Fixed in: Linux 3ecd2b229f5e42b36b5acf0e82510a70a632f041, Linux 8e1b52c15c81106456437f8e49575040e489e355, Linux 78c8454fdce0eeee962be004eb6d99860c80dad1, Linux 101c268bd2f37e965a5468353e62d154db38838e

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-50226 being exploited?

There is no confirmed exploitation: CVE-2024-50226 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-50226?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-50226?

Linux \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 3ecd2b229f5e42b36b5acf0e82510a70a632f041; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 8e1b52c15c81106456437f8e49575040e489e355; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 78c8454fdce0eeee962be004eb6d99860c80dad1; \>= 176baefb2eb5d7a3ddebe3ff803db1fce44574b5, \< 101c268bd2f37e965a5468353e62d154db38838e; Linux 6.0.

### Is there a fix for CVE-2024-50226?

Yes. Fixed in Linux 3ecd2b229f5e42b36b5acf0e82510a70a632f041, Linux 8e1b52c15c81106456437f8e49575040e489e355, Linux 78c8454fdce0eeee962be004eb6d99860c80dad1, Linux 101c268bd2f37e965a5468353e62d154db38838e. Upgrade Linux to 101c268bd2f37e965a5468353e62d154db38838e or later.

### How do I check if I'm affected by CVE-2024-50226?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/8e1b52c15c81106456437f8e49575040e489e355>
- patch: <https://git.kernel.org/stable/c/78c8454fdce0eeee962be004eb6d99860c80dad1>
- patch: <https://git.kernel.org/stable/c/101c268bd2f37e965a5468353e62d154db38838e>
- other: <https://git.kernel.org/stable/c/3ecd2b229f5e42b36b5acf0e82510a70a632f041>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-50226>

HTML: <https://flawdb.com/CVE-2024-50226> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-50226>
