CVE-2024-57952: Revert "libfs: fix infinite directory reads for offset dir"

Published Feb 12, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

Revert "libfs: fix infinite directory reads for offset dir"

The current directory offset allocator (based on mtreealloccyclic) stores the next offset value to return in octx->nextoffset. This mechanism typically returns values that increase monotonically over time. Eventually, though, the newly allocated offset value wraps back to a low number (say, 2) which is smaller than other already- allocated offset values.

Yu Kuai <yukuai3@huawei.com> reports that, after commit 64a7ce76fb90 ("libfs: fix infinite directory reads for offset dir"), if a directory's offset allocator wraps, existing entries are no longer visible via readdir/getdents because offsetreaddir() stops listing entries once an entry's offset is larger than octx->nextoffset. These entries vanish persistently -- they can be looked up, but will never again appear in readdir(3) output.

The reason for this is that the commit treats directory offsets as monotonically increasing integer values rather than opaque cookies, and introduces this comparison:

if (dentry2offset(dentry) >= lastindex) {

On 64-bit platforms, the directory offset value upper bound is 2^63 - 1. Directory offsets will monotonically increase for millions of years without wrapping.

On 32-bit platforms, however, LONGMAX is 2^31 - 1. The allocator can wrap after only a few weeks (at worst).

Revert commit 64a7ce76fb90 ("libfs: fix infinite directory reads for offset dir") to prepare for a fix that can work properly on 32-bit systems and might apply to recent LTS kernels where shmem employs the simpleoffset mechanism.

Affected Software

11 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=6.11<6.12.12
Linux Linux kernel=6.13
Linux Linux kernel=6.13-rc1
Linux Linux kernel=6.13-rc2
Linux Linux kernel=6.13-rc3
Linux Linux kernel=6.13-rc4
Linux Linux kernel=6.13-rc5
Linux Linux kernel=6.13-rc6
Linux Linux kernel=6.13-rc7
debian/linux<=5.10.223-1, <=5.10.234-1, <=6.1.129-1, <=6.1.135-1
6.12.27-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.27-1
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch Revert commit 64a7ce76fb90 (

Event History

Feb 12, 2025
CVE Published
via MITRE·01:52 PM
Data Sourced
via MITRE·01:52 PM
DescriptionSeverity
Data Sourced
via NVD·02:15 PM
RemedyDescriptionSeverityAffected Software
May 5, 2025
Data Sourced
via Ubuntu·02:34 PM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-57952?

CVE-2024-57952 has been classified with a moderate severity level due to potential risks associated with infinite directory reads.

2

How do I fix CVE-2024-57952?

To fix CVE-2024-57952, ensure that your Linux kernel is updated with the latest patches that address this vulnerability.

3

What systems are affected by CVE-2024-57952?

CVE-2024-57952 affects the Linux Kernel, particularly versions that include the vulnerable implementation of the directory offset allocator.

4

What potential impact does CVE-2024-57952 have on systems?

CVE-2024-57952 could lead to resource exhaustion due to infinite directory read operations, potentially disrupting normal system operations.

5

Is CVE-2024-57952 relevant for all Linux users?

Yes, CVE-2024-57952 is relevant for all Linux users as it impacts the underlying kernel functionality used by various applications.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203