CVE-2026-139454

cxl/port: Attach endpoints to a dport under the lock that pins it

Published Nov 30, 2026 CVSS 3.1 · 4.1 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

cxl/port: Attach endpoints to a dport under the lock that pins it

devm_cxl_enumerate_ports() and add_port_attach_ep() look up or create a
dport under its port's device lock, drop the lock, then pass the dport
to cxl_add_ep(). add_ep() reads dport->port before taking the lock, and
cxl_gpf_port_setup() reads and writes the dport with no lock held.

A concurrent cxl_detach_ep() for another memdev below the same port can
free the dport in that window: it calls del_dports() under the port lock
when the last endpoint leaves. The enumerating memdev then dereferences
freed memory.

Attach the endpoint and set up GPF while the port lock from the lookup
is still held. Make add_ep() assert that lock instead of taking it.
Under the lock, a dport found in port->dports is still live, since
removal erases it from the xarray before freeing it.

[ dj: Added kdoc update from Alison. ]

Analysis

AI-generated

Technical impact

The vulnerability is a use‑after‑free error in the Linux kernel’s CXL port subsystem. During enumeration of memory devices, the code releases a port lock before passing the dport pointer to another function that later dereferences it. If a concurrent detachment frees that dport, the enumerating path can access freed memory, leading to a crash or arbitrary code execution. The flaw is a classic double‑free race condition affecting the integrity of the kernel and possibly allowing privilege escalation.

Affected Systems

All systems that run a Linux kernel containing the unpatched CXL `cxl/port` subsystem. Previous kernel versions prior to the provided commit address the issue; no specific vendor other than Linux itself is mentioned.

Risk and Exploitability

The CVSS score and EPSS are not available, making the exact exploitation probability indeterminate. The vulnerability is not listed in the CISA KEV catalog, indicating no known public exploits. Exploitation would require local privileged access that can trigger concurrent enumeration and detachment of CXL devices, so remote exploitation is unlikely.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel update that incorporates the fix to the CXL port use‑after‑free.
  • If immediate patching is not possible, unload the CXL driver modules (e.g., run `modprobe -r cxl` or disable the module in kernel configuration) to prevent the vulnerable code from executing.
  • Restrict local access to CXL device enumeration and detachment operations by limiting permissions to trusted users or applying appropriate SELinux/AppArmor policies.

Generated by OpenCVE AI on December 1, 2026 at 18:35 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
Weaknesses CWE-825
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.1, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

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/port: Attach endpoints to a dport under the lock that pins it devm_cxl_enumerate_ports() and add_port_attach_ep() look up or create a dport under its port's device lock, drop the lock, then pass the dport to cxl_add_ep(). add_ep() reads dport->port before taking the lock, and cxl_gpf_port_setup() reads and writes the dport with no lock held. A concurrent cxl_detach_ep() for another memdev below the same port can free the dport in that window: it calls del_dports() under the port lock when the last endpoint leaves. The enumerating memdev then dereferences freed memory. Attach the endpoint and set up GPF while the port lock from the lookup is still held. Make add_ep() assert that lock instead of taking it. Under the lock, a dport found in port->dports is still live, since removal erases it from the xarray before freeing it. [ dj: Added kdoc update from Alison. ]
Title cxl/port: Attach endpoints to a dport under the lock that pins it
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-825

    Expired Pointer Dereference

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
Severity
Moderate
Public date
Nov 30, 2026, 1:34 PM