CVE-2026-138845

cxl/port: Clear cached dport pointers when a dport is removed

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

cxl/port: Clear cached dport pointers when a dport is removed

Switch decoders cache dport pointers in cxlsd->target[], and nothing
clears them when a dport is freed. Readers then dereference freed memory.

KASAN caught it under a cxl_test load/unload loop with concurrent sysfs
reads (abbreviated).

Clear the matching slots from cxl_dport_remove(), walking the port's
decoders the way cxl_port_update_decoder_targets() does on the add side.
Scan all nr_targets slots, the target[] allocation size, and clear every
hit.

Analysis

AI-generated

Technical impact

The vulnerability arises because the CXL port driver caches pointers to dport objects in an array, but does not clear these entries when a dport is removed. Subsequent reads of the cached pointer can therefore dereference freed memory, resulting in a kernel use‑after‑free. The defect was detected by KASAN during a load/unload loop with concurrent sysfs reads, highlighting an unstable interaction between module management and userspace access.

Affected Systems

All Linux kernel builds that include the cxl/port driver are affected, regardless of specific version numbers, since the flaw resides in the core driver logic. The problem manifests when the CXL subsystem is active and dports are added and removed by module loading or system reconfiguration.

Risk and Exploitability

This local use‑after‑free can lead to a kernel panic or, with appropriate exploitation, privilege escalation to root. The CVSS score is not provided, and no EPSS entry is available, but the nature of the flaw suggests a moderate likelihood of exploitation in environments where an attacker can control CXL device operations. The vulnerability is not listed in the CISA KEV catalog, indicating that no widely observed exploitation has yet been reported.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel update that includes the patch for the CXL port module (see the referenced commits).
  • If an update is not immediately available, unload or disable the CXL subsystem using "modprobe -r nvcxl" or equivalent to eliminate the dangling pointer references.
  • In systems that must continue to use CXL, temporarily restrict sysfs access to the CXL device files or remove debuggers that trigger concurrent read/write operations during module load/unload cycles.

Generated by OpenCVE AI on November 30, 2026 at 17:17 UTC.

Tracking

Sign in to view the affected projects.

Exploits

Explore public exploit intelligence with OpenCVE Pro.

Advisories

No advisories available
History
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: Clear cached dport pointers when a dport is removed Switch decoders cache dport pointers in cxlsd->target[], and nothing clears them when a dport is freed. Readers then dereference freed memory. KASAN caught it under a cxl_test load/unload loop with concurrent sysfs reads (abbreviated). Clear the matching slots from cxl_dport_remove(), walking the port's decoders the way cxl_port_update_decoder_targets() does on the add side. Scan all nr_targets slots, the target[] allocation size, and clear every hit.
Title cxl/port: Clear cached dport pointers when a dport is removed
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:25 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:17 PM
Modified
Nov 30, 2026, 2:17 PM