CVE-2025-38321 smb: Log an error when close_all_cached_dirs fails
A Linux kernel CIFS bug causes a kernel warning and potential instability during unmount under low memory conditions, requiring a patch to handle allocation failures gracefully.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-38321?
CVE-2025-38321 is a high-severity denial of service vulnerability in Linux kernel, published on 10 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
smb: Log an error when close_all_cached_dirs fails
Under low-memory conditions, close_all_cached_dirs() can't move the dentries to a separate list to dput() them once the locks are dropped. This will result in a "Dentry still in use" error, so add an error message that makes it clear this is what happened:
[ 495.281119] CIFS: VFS: \\otters.example.com\share Out of memory while dropping dentries [ 495.281595] ------------[ cut here ]------------ [ 495.281887] BUG: Dentry ffff888115531138{i=78,n=/} still in use (2) [unmount of cifs cifs] [ 495.282391] WARNING: CPU: 1 PID: 2329 at fs/dcache.c:1536 umount_check+0xc8/0xf0
Also, bail out of looping through all tcons as soon as a single allocation fails, since we're already in trouble, and kmalloc() attempts for subseqeuent tcons are likely to fail just like the first one did.
Which versions are affected by CVE-2025-38321?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2025-38321?
Apply the vendor's patch.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2025-38321 being exploited?
There is no known exploitation of CVE-2025-38321 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-64899, BELL-CVE-2025-38321, DEBIAN-CVE-2025-38321, GHSA-v7vw-mgw4-jqvj, ROOT-OS-DEBIAN-11-CVE-2025-38321, ROOT-OS-DEBIAN-12-CVE-2025-38321 and 3 more.