Junglewise Threat Intelligence

CVE-2024-57940: Linux Kernel infinite loop in exfat_readdir

CVE-2024-57940 · Severity: medium · CVSS 5.5 · Published 2025-01-21

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability in the Linux kernel's exFAT file system driver can allow a local user to cause a system hang. By using a specially crafted or corrupted exFAT storage device, an attacker can trigger an infinite loop that prevents the system from completing file operations. This results in a denial-of-service where other tasks waiting for file system access will stop responding.

Technical details

A vulnerability exists in the exfat_readdir() function of the Linux kernel's exFAT implementation (CWE-835). When a file system is corrupted such that a cluster is linked to itself (forming a circular chain) and contains an unused directory entry, the 'dentry' counter is not incremented. This prevents the 'dentry < max_dentries' exit condition from being met, resulting in an infinite loop while holding the 's_lock' mutex. A local attacker with the ability to mount or access a crafted exFAT volume can trigger this loop, causing a kernel hang and denial of service for any other tasks attempting to synchronize or access the file system. The issue has been patched in various stable kernel branches by ensuring the cluster chain traversal stops upon encountering an unused directory entry.

Affected products

  • Linux Linux Kernel 5.7 to 6.1.125, 6.2 to 6.6.72, 6.7 to 6.12.10, 6.13-rc1 to 6.13-rc6

Timeline

  • 2025-01-21: disclosed
  • 2025-01-21: advisory

References

Related threats