What’s Vulnerable › Vulnerabilities

CVE-2025-40328: smb: client: fix potential UAF in smb2_close_cached_fid()

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.

Affected products

How to fix

Upgrade to a fixed version: Linux 6.18. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2025-40328 or the next vulnerability affects your stack