# CVE-2025-40002: thunderbolt: Fix use-after-free in tb\_dp\_dprx\_work

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-10-18T08:03:22.718Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, \< c07923f6a8729fc27ee652221a51702ff6654097; \>= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, \< 67600ccfc4f38ebd331b9332ac94717bfbc87ea7
- Anyone running Linux 6.14

## Description

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.

## Affected and fixed versions

- Linux: \>= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, \< c07923f6a8729fc27ee652221a51702ff6654097; \>= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, \< 67600ccfc4f38ebd331b9332ac94717bfbc87ea7 (cvelist)
- Linux: 6.14 (cvelist)

## Mitigation

- Upgrade Linux to 67600ccfc4f38ebd331b9332ac94717bfbc87ea7 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-40002. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40002.md
Affected: Linux >= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, < c07923f6a8729fc27ee652221a51702ff6654097; >= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, < 67600ccfc4f38ebd331b9332ac94717bfbc87ea7; Linux 6.14
Fixed in: Linux 67600ccfc4f38ebd331b9332ac94717bfbc87ea7

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-40002 being exploited?

There is no confirmed exploitation: CVE-2025-40002 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-40002?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2025-40002?

Linux \>= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, \< c07923f6a8729fc27ee652221a51702ff6654097; \>= d6d458d42e1e1544a18f37f1d5c840e00d5261b9, \< 67600ccfc4f38ebd331b9332ac94717bfbc87ea7; Linux 6.14.

### Is there a fix for CVE-2025-40002?

Yes. Fixed in Linux 67600ccfc4f38ebd331b9332ac94717bfbc87ea7. Upgrade Linux to 67600ccfc4f38ebd331b9332ac94717bfbc87ea7 or later.

### How do I check if I'm affected by CVE-2025-40002?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/c07923f6a8729fc27ee652221a51702ff6654097>
- other: <https://git.kernel.org/stable/c/67600ccfc4f38ebd331b9332ac94717bfbc87ea7>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-40002>

HTML: <https://flawdb.com/CVE-2025-40002> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-40002>
