# CVE-2026-139454: cxl/port: Attach endpoints to a dport under the lock that pins it

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 10% of CVEs (2026-12-01)
- Published: 2026-11-30T13:34:54.290Z
- Modified: 2026-11-30T14:19:16.483Z
- Assigned by: Linux

## 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. ]

(As written by CVE List.)

## Affected

- Linux Linux: from de516b40116e98c60ee475e92108453686098c85 before 35939aa04c41e2674ce1728c26390a48cc80eb4e; from de516b40116e98c60ee475e92108453686098c85 before 75a9f9da262c73a2d22bccbe13671aa6d2affa0c; from de516b40116e98c60ee475e92108453686098c85 before bcda00c78d075340fe30cb6c980507fac711e7d1; 6.0 (not affected: before 6.0; from 6.18.66 up to 6.18.*; from 7.3.6 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/35939aa04c41e2674ce1728c26390a48cc80eb4e>
- <https://git.kernel.org/stable/c/75a9f9da262c73a2d22bccbe13671aa6d2affa0c>
- <https://git.kernel.org/stable/c/bcda00c78d075340fe30cb6c980507fac711e7d1>

## Sources

- CVE List: [CVE-2026-139454](https://www.cve.org/CVERecord?id=CVE-2026-139454), CVE Terms of Use, modified 2026-11-30
- NVD: [CVE-2026-139454](https://nvd.nist.gov/vuln/detail/CVE-2026-139454), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-139454 · Whole record: https://cve.day/CVE-2026-139454.json · Rebuilt by cve.day 2026-11-30T14:33:12.891Z
