VYPR
Unrated severityNVD Advisory· Published Dec 9, 2025· Updated Apr 15, 2026

CVE-2025-40328

CVE-2025-40328

Description

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

smb: client: fix potential UAF in smb2_close_cached_fid()

find_or_create_cached_dir() could grab a new reference after kref_put() had seen the refcount drop to zero but before cfid_list_lock is acquired in smb2_close_cached_fid(), leading to use-after-free.

Switch to kref_put_lock() so cfid_release() is called with cfid_list_lock held, closing that gap.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A use-after-free vulnerability in the Linux kernel's SMB client, where a race condition in smb2_close_cached_fid() could allow a local attacker to cause memory corruption or privilege escalation.

Vulnerability

Overview

A use-after-free (UAF) vulnerability exists in the Linux kernel's SMB client implementation, specifically in the function smb2_close_cached_fid(). The root cause is a race condition where find_or_create_cached_dir() could obtain a new reference to a cached directory fid after kref_put() had already decremented the reference count to zero, but before the cfid_list_lock is acquired. This race window allows the object to be freed and then re-referenced, leading to a use-after-free condition [1].

Exploitation

To exploit this vulnerability, an attacker would need local access to the system and the ability to trigger SMB operations that manipulate cached directory file identifiers (fids). The race condition occurs between the reference count drop and the lock acquisition, requiring precise timing. No authentication is needed beyond local user access, as the SMB client operations are triggered by user-space processes [1].

Impact

Successful exploitation could allow an attacker to cause memory corruption, potentially leading to a denial of service (system crash) or, in some cases, arbitrary code execution in kernel context. The vulnerability is rated with a CVSS score of 7.0 (High), indicating significant impact on confidentiality, integrity, and availability [1].

Mitigation

The fix has been applied in the Linux kernel stable tree via commit 734e99623c5b. The patch replaces the unprotected kref_put() with kref_put_lock(), ensuring that the release function cfid_release() is called while holding cfid_list_lock, thus closing the race window. Users are advised to update their kernel to a version containing this commit [1].

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

1

Patches

4

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.