CVE-2024-57940 exfat: fix the infinite loop in exfat_readdir()
A corrupted exFAT filesystem can cause an infinite loop in the Linux kernel, leading to a system hang and denial of service.
- 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-2024-57940?
CVE-2024-57940 is a medium-severity denial of service vulnerability in Linux kernel, published on 21 Jan 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:
exfat: fix the infinite loop in exfat_readdir()
If the file system is corrupted so that a cluster is linked to itself in the cluster chain, and there is an unused directory entry in the cluster, 'dentry' will not be incremented, causing condition 'dentry < max_dentries' unable to prevent an infinite loop.
This infinite loop causes s_lock not to be released, and other tasks will hang, such as exfat_sync_fs().
This commit stops traversing the cluster chain when there is unused directory entry in the cluster to avoid this infinite loop.
Weakness: CWE-835
Which versions are affected by CVE-2024-57940?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-57940?
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-2024-57940 being exploited?
There is no known exploitation of CVE-2024-57940 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-55904, AZL-55910, BELL-CVE-2024-57940, DEBIAN-CVE-2024-57940, GHSA-8pw9-7gv3-535c, UBUNTU-CVE-2024-57940.