CVE-2025-40328
kernel: smb: client: fix potential UAF in smb2_close_cached_fid()
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · December 9, 2025
Updated · October 2, 2026
Description
A use-after-free flaw was found in the Linux kernel's SMB client implementation. In smb2_close_cached_fid(), a race condition exists where find_or_create_cached_dir() could acquire a new reference to a cached directory file ID (cfid) after kref_put() observed the reference count drop to zero but before the cfid_list_lock is acquired. This timing gap allows access to freed memory, potentially leading to system instability, data corruption, or privilege escalation.
Statement
This vulnerability requires local access and the ability to mount SMB/CIFS shares. The race condition window is narrow, making exploitation difficult but not impossible. Systems actively using SMB mounts are at higher risk.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this issue, prevent the cifs module from being loaded if SMB/CIFS filesystem access is not required. See https://access.redhat.com/solutions/41278 for instructions on how to blacklist a kernel module.
CVSS / CWE
CVSS 3.1 · 5.5CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CWE-825 · Expired Pointer Dereference