CVE-2025-22077
Linux Kernel vulnerability analysis and mitigation

Overview

CVE-2025-22077 is a vulnerability in the Linux kernel's SMB client implementation discovered in April 2025. The issue involves a netns refcount imbalance that can cause resource leaks and potential use-after-free vulnerabilities in the CIFS client socket handling (NVD).

Technical details

The vulnerability stems from improper network namespace reference counting in the SMB client code. When a reconnect occurs for a CIFS connection, the socket state transitions to FINWAIT1, and inetcskclearxmittimerssync() in tcpclose() stops all timers for the socket. If an incoming FIN packet is lost, the socket can remain in FINWAIT1 indefinitely, potentially leading to socket leaks up to net.ipv4.tcpmaxorphans. The issue is particularly problematic for TCP sockets because they require timers to close connections gracefully even after the socket is closed (NVD).

Impact

The vulnerability can result in two main issues: 1) Netns refcount leaks where network namespace references are not properly released, leading to resource leaks, and 2) Potential use-after-free vulnerabilities where the timer could be fired after the socket is closed and its netns is freed up (Security Tracker).

Mitigation and workarounds

The issue has been fixed by reverting commit e9f2517a3e18 and maintaining proper netns reference counting. The correct approach involves converting the CIFS client socket to have a reference to netns (sk->sknetrefcnt == 1). For the LOCKDEP issue, the module unload can be prevented by bumping the module refcount when switching the LOCKDEP key in socklockinitclassand_name() (NVD).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management