CVE-2025-40002: thunderbolt: Fix use-after-free in tb_dp_dprx_work
In the Linux kernel, the following vulnerability has been resolved:
thunderbolt: Fix use-after-free in tb_dp_dprx_work
The original code relies on cancel_delayed_work() in tb_dp_dprx_stop(),
which does not ensure that the delayed work item tunnel->dprx_work has
fully completed if it was already running. This leads to use-after-free
scenarios where tb_tunnel is deallocated by tb_tunnel_put(), while
tunnel->dprx_work remains active and attempts to dereference tb_tunnel
in tb_dp_dprx_work().
A typical race condition is illustrated below:
CPU 0 | CPU 1
tb_dp_tunnel_active() |
tb_deactivate_and_free_tunnel()| tb_dp_dprx_start()
tb_tunnel_deactivate() | queue_delayed_work()
tb_dp_activate() |
tb_dp_dprx_stop() | tb_dp_dprx_work() //delayed worker
cancel_delayed_work() |
tb_tunnel_put(tunnel); |
| tunnel = container_of(...); //UAF
| tunnel-> //UAF
Replacing cancel_delayed_work() with cancel_delayed_work_sync() is
not feasible as it would introduce a deadlock: both tb_dp_dprx_work()
and the cleanup path acquire tb->lock, and cancel_delayed_work_sync()
would wait indefinitely for the work item that cannot proceed.
Instead, implement proper reference counting:
- If cancel_delayed_work() returns true (work is pending), we release
the reference in the stop function.
- If it returns false (work is executing or already completed), the
reference is released in delayed work function itself.
This ensures the tb_tunnel remains valid during work item execution
while preventing memory leaks.
This bug was found by static analysis.
Security readout for executives and security teams
Plain-English summary
CVE-2025-40002 is a Linux kernel bug in Thunderbolt DisplayPort tunneling cleanup. A timing race can leave background work using a tunnel object after it has been freed, risking kernel instability or memory corruption. The source bundle does not provide a CVSS score or confirmed exploitation.
Executive priority
Track and remediate through normal kernel patch management, with higher priority for Thunderbolt-enabled endpoint fleets. Business urgency is uncertain because severity, exploitability, and affected distribution details are incomplete in the provided record.
Technical view
The flaw is a use-after-free in tb_dp_dprx_work. tb_dp_dprx_stop uses cancel_delayed_work, which may not stop already running delayed work before tb_tunnel_put frees tb_tunnel. The kernel fix adds reference-count handling instead of cancel_delayed_work_sync, which could deadlock on tb->lock.
Likely exposure
Likely relevant to Linux systems running affected kernel versions with Thunderbolt DisplayPort tunneling paths. The bundle does not identify affected distributions, hardware prerequisites, or whether typical server configurations are reachable.
Exploitation context
No active exploitation is reported in the provided sources, and KEV is false. The bug was found by static analysis. The bundle does not describe a proof of concept, attacker requirements, or practical exploitability.
Researcher notes
The race is between tunnel deactivation/free and delayed DisplayPort receiver work. The important validation question is whether a deployed kernel contains the refcounting fix. Avoid assuming remote reachability or privilege impact without additional vendor analysis.
Mitigation direction
Apply a vendor kernel update containing the referenced stable fixes.
Prioritize Thunderbolt-enabled laptops, workstations, and exposed docking setups.
Check distribution advisories for exact affected and fixed package versions.
Disable or restrict Thunderbolt where operationally acceptable until patched.
Validation and detection
Inventory Linux kernel versions on Thunderbolt-capable systems.
Confirm whether deployed kernels include the referenced stable commits.
Review distro security notices for CVE-2025-40002 package status.
Check fleet configuration for Thunderbolt and DisplayPort tunneling use.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-40002 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
0ADP providers
3Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Oct 18, 2025, 08:03 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.