{"id":"CVE-2026-139455","aliases":["CVE-2026-139455"],"related":[],"kind":"vulnerability","state":"published","title":"cxl/core: Hold the dport host lock across dport lookup and use","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncxl/core: Hold the dport host lock across dport lookup and use\n\nCallers of cxl_pci_find_port() and cxl_mem_find_port() can be handed a\n'struct cxl_dport' that is already freed, and all four dereference it\nwithout the lock that would prevent that.\n\nA dport is kzalloc()'d into a devres group on its host device, so it dies\nwhen that host unbinds. The host is &port->dev for a switch port and\nport->uport_dev for the root port.\n\nBoth helpers return the dport through an output parameter. The caller's\nport reference pins struct cxl_port, not the dport allocation, and the\nlookup itself is a bare xa_load() under no lock.\n\nAdd cxl_port_dport_host() to name the device that pins a dport, and\ncxl_pci_find_dport() / cxl_mem_find_dport() to look one up with that\ndevice's lock held and asserted. Convert the four callers to use them and\nbail if the dport is gone. cxl_port_add_dport() already follows this rule.\n\ncxl_mem_probe() chose its endpoint devm host from dport->rch, which meant\ndereferencing the dport before taking any lock. Use cxl_port_dport_host():\nrch dports only ever land on the root port, so it selects the same device\nwithout needing the dport.\n\nWith every caller converted, the dport output parameter of\ncxl_pci_find_port() and cxl_mem_find_port() is unused. Drop it.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncxl/core: Hold the dport host lock across dport lookup and use\n\nCallers of cxl_pci_find_port() and cxl_mem_find_port() can be handed a\n'struct cxl_dport' that is already freed, and all four dereference it\nwithout the lock that would prevent that.\n\nA dport is kzalloc()'d into a devres group on its host device, so it dies\nwhen that host unbinds. The host is &port->dev for a switch port and\nport->uport_dev for the root port.\n\nBoth helpers return the dport through an output parameter. The caller's\nport reference pins struct cxl_port, not the dport allocation, and the\nlookup itself is a bare xa_load() under no lock.\n\nAdd cxl_port_dport_host() to name the device that pins a dport, and\ncxl_pci_find_dport() / cxl_mem_find_dport() to look one up with that\ndevice's lock held and asserted. Convert the four callers to use them and\nbail if the dport is gone. cxl_port_add_dport() already follows this rule.\n\ncxl_mem_probe() chose its endpoint devm host from dport->rch, which meant\ndereferencing the dport before taking any lock. Use cxl_port_dport_host():\nrch dports only ever land on the root port, so it selects the same device\nwithout needing the dport.\n\nWith every caller converted, the dport output parameter of\ncxl_pci_find_port() and cxl_mem_find_port() is unused. Drop it.","source":"cvelist"}],"published":"2026-11-30T13:34:54.855Z","modified":"2026-11-30T14:19:16.627Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"733b57f262b0e9f05ffeac102fe5bd729e263170","fixed":"5224ef91eaf0f84cc323e7701d24a1e7748d106c","status":"affected"},{"type":"git","introduced":"733b57f262b0e9f05ffeac102fe5bd729e263170","fixed":"b72a03ebd9586d59992ecaa6ceed11ea96835734","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.5","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.5","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/5224ef91eaf0f84cc323e7701d24a1e7748d106c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b72a03ebd9586d59992ecaa6ceed11ea96835734","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139455","url":"https://www.cve.org/CVERecord?id=CVE-2026-139455","licence":"CVE Terms of Use","modified":"2026-11-30T13:34:54.855Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139455","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139455","licence":"Public domain","modified":"2026-11-30T14:19:16.627Z"}],"updatedAt":"2026-11-30T14:33:24.372Z","epss":{"score":0.0019,"percentile":0.09092,"date":"2026-12-01T12:00:22.000Z"}}