# CVE-2025-22077: Revert "smb: client: fix TCP timers deadlock after rmmod"

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

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.56% (percentile 40, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-04-16T14:12:27.882Z
- **Modified:** 2026-10-15T22:18:14.703Z

## Who should check

- Anyone running Linux \>= 906807c734ed219dcb2e7bbfde5c4168ed72a3d0, \< 8dbf060480236877703bff0106fc984576184d11; \>= 127e907e11ccd54b59bb78fc22c43ccb76c71079, \< f761eeefd531e6550cd3a5c047835b4892acb00d; \>= e9f2517a3e18a54a3943c098d2226b245d488801, \< 4b6f6bf1bde8d6045c389fda8d21c304dfe49384; \>= e9f2517a3e18a54a3943c098d2226b245d488801, \< 95d2b9f693ff2a1180a23d7d59acc0c4e72f4c41; \>= 6.6.68, \< 6.6.88; \>= 6.12.7, \< 6.12.25
- Anyone running Linux 6.13

## Description

In the Linux kernel, the following vulnerability has been resolved:

Revert "smb: client: fix TCP timers deadlock after rmmod"

This reverts commit e9f2517a3e18a54a3943c098d2226b245d488801.

Commit e9f2517a3e18 ("smb: client: fix TCP timers deadlock after
rmmod") is intended to fix a null-ptr-deref in LOCKDEP, which is
mentioned as CVE-2024-54680, but is actually did not fix anything;
The issue can be reproduced on top of it. \[0\]

Also, it reverted the change by commit ef7134c7fc48 ("smb: client:
Fix use-after-free of network namespace.") and introduced a real
issue by reviving the kernel TCP socket.

When a reconnect happens for a CIFS connection, the socket state
transitions to FIN\_WAIT\_1.  Then, inet\_csk\_clear\_xmit\_timers\_sync()
in tcp\_close() stops all timers for the socket.

If an incoming FIN packet is lost, the socket will stay at FIN\_WAIT\_1
forever, and such sockets could be leaked up to net.ipv4.tcp\_max\_orphans.

Usually, FIN can be retransmitted by the peer, but if the peer aborts
the connection, the issue comes into reality.

I warned about this privately by pointing out the exact report \[1\],
but the bogus fix was finally merged.

So, we should not stop the timers to finally kill the connection on
our side in that case, meaning we must not use a kernel socket for
TCP whose sk-\>sk\_net\_refcnt is 0.

The kernel socket does not have a reference to its netns to make it
possible to tear down netns without cleaning up every resource in it.

For example, tunnel devices use a UDP socket internally, but we can
destroy netns without removing such devices and let it complete
during exit.  Otherwise, netns would be leaked when the last application
died.

However, this is problematic for TCP sockets because TCP has timers to
close the connection gracefully even after the socket is close()d.  The
lifetime of the socket and its netns is different from the lifetime of
the underlying connection.

If the socket user does not maintain the netns lifetime, the timer could
be fired after the socket is close()d and its netns is freed up, resulting
in use-after-free.

Actually, we have seen so many similar issues and converted such sockets
to have a reference to netns.

That's why I converted the CIFS client socket to have a reference to
netns (sk-\>sk\_net\_refcnt == 1), which is somehow mentioned as out-of-scope
of CIFS and technically wrong in e9f2517a3e18, but \*\*is in-scope and right
fix\*\*.

Regarding the LOCKDEP issue, we can prevent the module unload by
bumping the module refcount when switching the LOCKDDEP key in
sock\_lock\_init\_class\_and\_name(). \[2\]

For a while, let's revert the bogus fix.

Note that now we can use sk\_net\_refcnt\_upgrade() for the socket
conversion, but I'll do so later separately to make backport easy.

## Affected and fixed versions

- Linux: \>= 906807c734ed219dcb2e7bbfde5c4168ed72a3d0, \< 8dbf060480236877703bff0106fc984576184d11; \>= 127e907e11ccd54b59bb78fc22c43ccb76c71079, \< f761eeefd531e6550cd3a5c047835b4892acb00d; \>= e9f2517a3e18a54a3943c098d2226b245d488801, \< 4b6f6bf1bde8d6045c389fda8d21c304dfe49384; \>= e9f2517a3e18a54a3943c098d2226b245d488801, \< 95d2b9f693ff2a1180a23d7d59acc0c4e72f4c41; \>= 6.6.68, \< 6.6.88; \>= 6.12.7, \< 6.12.25 (cvelist)
- Linux: 6.13 (cvelist)

## Mitigation

- Upgrade Linux to 6.12.25 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-22077. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-22077.md
Affected: Linux >= 906807c734ed219dcb2e7bbfde5c4168ed72a3d0, < 8dbf060480236877703bff0106fc984576184d11; >= 127e907e11ccd54b59bb78fc22c43ccb76c71079, < f761eeefd531e6550cd3a5c047835b4892acb00d; >= e9f2517a3e18a54a3943c098d2226b245d488801, < 4b6f6bf1bde8d6045c389fda8d21c304dfe49384; >= e9f2517a3e18a54a3943c09…
Fixed in: Linux 8dbf060480236877703bff0106fc984576184d11, Linux 4b6f6bf1bde8d6045c389fda8d21c304dfe49384, Linux 95d2b9f693ff2a1180a23d7d59acc0c4e72f4c41, Linux 6.6.88, Linux 6.12.25

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-22077 being exploited?

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

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

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

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

Linux \>= 906807c734ed219dcb2e7bbfde5c4168ed72a3d0, \< 8dbf060480236877703bff0106fc984576184d11; \>= 127e907e11ccd54b59bb78fc22c43ccb76c71079, \< f761eeefd531e6550cd3a5c047835b4892acb00d; \>= e9f2517a3e18a54a3943c098d2226b245d488801, \< 4b6f6bf1bde8d6045c389fda8d21c304dfe49384; \>= e9f2517a3e18a54a3943c098d2226b245d488801, \< 95d2b9f693ff2a1180a23d7d59acc0c4e72f4c41; \>= 6.6.68, \< 6.6.88; \>= 6.12.7, \< 6.12.25; Linux 6.13.

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

Yes. Fixed in Linux 8dbf060480236877703bff0106fc984576184d11, Linux 4b6f6bf1bde8d6045c389fda8d21c304dfe49384, Linux 95d2b9f693ff2a1180a23d7d59acc0c4e72f4c41, Linux 6.6.88, Linux 6.12.25. Upgrade Linux to 6.12.25 or later.

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

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

- patch: <https://git.kernel.org/stable/c/8dbf060480236877703bff0106fc984576184d11>
- patch: <https://git.kernel.org/stable/c/f761eeefd531e6550cd3a5c047835b4892acb00d>
- patch: <https://git.kernel.org/stable/c/4b6f6bf1bde8d6045c389fda8d21c304dfe49384>
- patch: <https://git.kernel.org/stable/c/95d2b9f693ff2a1180a23d7d59acc0c4e72f4c41>

## 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-22077>

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