CVE-2025-38527: smb: client: fix use-after-free in cifs_oplock_break
In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix use-after-free in cifsoplockbreak
A race condition can occur in cifsoplockbreak() leading to a use-after-free of the cinode structure when unmounting:
cifsoplockbreak() cifsFileInfoput(cfile) cifsFileInfoputfinal() cifssbdeactive() [last ref, start releasing sb] killsb() killanonsuper() genericshutdownsuper() evictinodes() disposelist() evict() destroyinode() callrcu(&inode->ircu, icallback) spinlock(&cinode->openfilelock) <- OK [later] icallback() cifsfreeinode() kmemcachefree(cinode) spinunlock(&cinode->openfilelock) <- UAF cifsdoneoplockbreak(cinode) <- UAF
The issue occurs when umount has already released its reference to the superblock. When cifsFileInfoput() calls cifssbdeactive(), this releases the last reference, triggering the immediate cleanup of all inodes under RCU. However, cifsoplockbreak() continues to access the cinode after this point, resulting in use-after-free.
Fix this by holding an extra reference to the superblock during the entire oplock break operation. This ensures that the superblock and its inodes remain valid until the oplock break completes.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38527?
CVE-2025-38527 has been classified as a high-severity vulnerability due to its potential to cause a use-after-free condition.
How do I fix CVE-2025-38527?
To fix CVE-2025-38527, you should update your Linux kernel to the latest patched version that addresses this vulnerability.
What software is affected by CVE-2025-38527?
CVE-2025-38527 affects the Linux Kernel in implementations using CIFS, particularly involving oplock break functionality.
What happens if CVE-2025-38527 is exploited?
Exploiting CVE-2025-38527 can lead to undefined behavior, system crashes, or potential remote code execution due to a race condition and use-after-free issue.
When was CVE-2025-38527 discovered?
CVE-2025-38527 was identified and documented in 2025, highlighting an important security issue within the Linux Kernel's CIFS functionality.