{"id":"CVE-2026-139455","state":"PUBLISHED","title":"cxl/core: Hold the dport host lock across dport lookup and use","description":"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.","publishedAt":"2026-11-30T13:34:54.855Z","updatedAt":"2026-11-30T13:34:54.855Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"733b57f262b0e9f05ffeac102fe5bd729e263170","status":"affected","lessThan":"5224ef91eaf0f84cc323e7701d24a1e7748d106c","versionType":"git"},{"version":"733b57f262b0e9f05ffeac102fe5bd729e263170","status":"affected","lessThan":"b72a03ebd9586d59992ecaa6ceed11ea96835734","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/cxl/core/core.h","drivers/cxl/core/pci.c","drivers/cxl/core/port.c","drivers/cxl/core/ras_rch.c","drivers/cxl/cxl.h","drivers/cxl/mem.c","drivers/cxl/pci.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.5","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.5","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/cxl/core/core.h","drivers/cxl/core/pci.c","drivers/cxl/core/port.c","drivers/cxl/core/ras_rch.c","drivers/cxl/cxl.h","drivers/cxl/mem.c","drivers/cxl/pci.c"]}],"references":["https://git.kernel.org/stable/c/5224ef91eaf0f84cc323e7701d24a1e7748d106c","https://git.kernel.org/stable/c/b72a03ebd9586d59992ecaa6ceed11ea96835734"],"weaknesses":[],"ingestedAt":"2026-11-30T13:50:04.417Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139455.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139455","state":"PUBLISHED","datePublished":"2026-11-30T13:34:54.855Z","dateUpdated":"2026-11-30T13:34:54.855Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.934Z"},"containers":{"cna":{"title":"cxl/core: Hold the dport host lock across dport lookup and use","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"733b57f262b0e9f05ffeac102fe5bd729e263170","status":"affected","lessThan":"5224ef91eaf0f84cc323e7701d24a1e7748d106c","versionType":"git"},{"version":"733b57f262b0e9f05ffeac102fe5bd729e263170","status":"affected","lessThan":"b72a03ebd9586d59992ecaa6ceed11ea96835734","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/cxl/core/core.h","drivers/cxl/core/pci.c","drivers/cxl/core/port.c","drivers/cxl/core/ras_rch.c","drivers/cxl/cxl.h","drivers/cxl/mem.c","drivers/cxl/pci.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.5","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.5","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/cxl/core/core.h","drivers/cxl/core/pci.c","drivers/cxl/core/port.c","drivers/cxl/core/ras_rch.c","drivers/cxl/cxl.h","drivers/cxl/mem.c","drivers/cxl/pci.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/5224ef91eaf0f84cc323e7701d24a1e7748d106c"},{"url":"https://git.kernel.org/stable/c/b72a03ebd9586d59992ecaa6ceed11ea96835734"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:34:54.855Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.5","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.5","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}