CVE-2026-139455: cxl/core: Hold the dport host lock across dport lookup and use

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

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

Callers of cxlpcifindport() and cxlmemfindport() can be handed a 'struct cxldport' 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->uportdev for the root port.

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

Add cxlportdporthost() to name the device that pins a dport, and cxlpcifinddport() / cxlmemfinddport() 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. cxlportadddport() already follows this rule.

cxlmemprobe() chose its endpoint devm host from dport->rch, which meant dereferencing the dport before taking any lock. Use cxlportdporthost(): 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 cxlpcifindport() and cxlmemfindport() is unused. Drop it.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Update CXL core dport handling: add cxl_port_dport_host() to identify the pinning device (&port->dev for a switch port and port->uport_dev for a root port); add cxl_pci_find_dport() and cxl_mem_find_dport() to look up a dport with that host device's lock held and return it through an output parameter; convert the four callers to use these helpers, hold the host lock across lookup and use, and bail if the dport is gone. Remove the now-unused dport output parameter from cxl_pci_find_port() and cxl_mem_find_port().

Event History

Nov 30, 2026
CVE Published
via MITRE·01:34 PM
Data Sourced
via MITRE·01:34 PM
Description

Frequently Asked Questions

1

What condition is required for the use-after-free to occur?

A dport host device must unbind while a caller is looking up or using the associated struct cxl_dport. The caller's reference to struct cxl_port does not keep the dport allocation alive.

2

Which CXL paths are implicated by the fix?

The fix changes the PCI and memory dport lookup paths, including cxl_pci_find_port(), cxl_mem_find_port(), and their callers. It also changes cxl_mem_probe() to determine the dport host before dereferencing the dport.

3

What synchronization protects a dport from being freed?

The lock of the device hosting the dport must be held across both lookup and use. For switch ports this host is port->dev; for root ports it is port->uport_dev, and callers now bail out when the dport is gone.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203