CVE-2026-139455

cxl/core: Hold the dport host lock across dport lookup and use

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

cxl/core: Hold the dport host lock across dport lookup and use

Callers of cxl_pci_find_port() and cxl_mem_find_port() can be handed a
'struct cxl_dport' that is already freed, and all four dereference it
without the lock that would prevent that.

A dport is kzalloc()'d into a devres group on its host device, so it dies
when that host unbinds. The host is &port->dev for a switch port and
port->uport_dev for the root port.

Both helpers return the dport through an output parameter. The caller's
port reference pins struct cxl_port, not the dport allocation, and the
lookup itself is a bare xa_load() under no lock.

Add cxl_port_dport_host() to name the device that pins a dport, and
cxl_pci_find_dport() / cxl_mem_find_dport() to look one up with that
device's lock held and asserted. Convert the four callers to use them and
bail if the dport is gone. cxl_port_add_dport() already follows this rule.

cxl_mem_probe() chose its endpoint devm host from dport->rch, which meant
dereferencing the dport before taking any lock. Use cxl_port_dport_host():
rch dports only ever land on the root port, so it selects the same device
without needing the dport.

With every caller converted, the dport output parameter of
cxl_pci_find_port() and cxl_mem_find_port() is unused. Drop it.

Analysis

AI-generated

Technical impact

The vulnerability arises in the Linux CXL core module where the cxl_pci_find_port() and cxl_mem_find_port() functions can return a pointer to a struct cxl_dport that has already been freed because the lock protecting the dport lookup was missing. Subsequent dereferences of that freed structure lead to a use‑after‑free condition that can corrupt memory and potentially allow an attacker to execute arbitrary code. The weakness is a classic use‑after‑free flaw (CWE‑416).

Affected Systems

All Linux kernel builds that include the CXL core driver before the patch is applied. The exact kernel revisions are not enumerated, but any kernel containing the older cxl core implementation is affected.

Risk and Exploitability

The use‑after‑free introduces a severe compromise risk; an adversary with the ability to trigger the freed‑structure dereference could achieve local privilege escalation or arbitrary code execution. No CVSS score is publicly documented, and the EPSS score is not available. The vulnerability is not listed in the CISA KEV catalog, which suggests that there are currently no known widespread exploits, but the high severity of the flaw warrants immediate attention.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a release that includes the cxl core lock fix (see commit ids 5224ef91eaf0f84cc323e7701d24a1e7748d106c and b72a03ebd9586d59992ecaa6ceed11ea96835734).
  • If an immediate kernel upgrade is not possible, disable CXL support in the kernel configuration or unload any cxl modules to avoid the use‑after‑free scenario.
  • Verify that dport objects are not allocated by checking kernel logs or the CXL sysfs entries before modifying the host device configuration.

Generated by OpenCVE AI on November 30, 2026 at 23:00 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: cxl/core: Hold the dport host lock across dport lookup and use Callers of cxl_pci_find_port() and cxl_mem_find_port() can be handed a 'struct cxl_dport' that is already freed, and all four dereference it without the lock that would prevent that. A dport is kzalloc()'d into a devres group on its host device, so it dies when that host unbinds. The host is &port->dev for a switch port and port->uport_dev for the root port. Both helpers return the dport through an output parameter. The caller's port reference pins struct cxl_port, not the dport allocation, and the lookup itself is a bare xa_load() under no lock. Add cxl_port_dport_host() to name the device that pins a dport, and cxl_pci_find_dport() / cxl_mem_find_dport() to look one up with that device's lock held and asserted. Convert the four callers to use them and bail if the dport is gone. cxl_port_add_dport() already follows this rule. cxl_mem_probe() chose its endpoint devm host from dport->rch, which meant dereferencing the dport before taking any lock. Use cxl_port_dport_host(): rch dports only ever land on the root port, so it selects the same device without needing the dport. With every caller converted, the dport output parameter of cxl_pci_find_port() and cxl_mem_find_port() is unused. Drop it.
Title cxl/core: Hold the dport host lock across dport lookup and use
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:34 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM