# CVE-2024-57884: mm: vmscan: account for free pages to prevent infinite Loop in throttle\_direct\_reclaim()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-835
- **Published:** 2025-01-15T13:05:37.152Z
- **Modified:** 2026-10-15T02:17:11.623Z

## Who should check

- Anyone running Linux \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 66cd37660ec34ec444fe42f2277330ae4a36bb19; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< d675fefbaec3815b3ae0af1bebd97f27df3a05c8; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 63eac98d6f0898229f515cb62fe4e4db2430e99c; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< bfb701192129803191c9cd6cdd1f82cd07f8de2c; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 1ff2302e8aeac7f2eedb551d7a89617283b5c6b2; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 58d0d02dbc67438fc80223fdd7bbc49cf0733284; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 6aaced5abd32e2a57cd94fd64f824514d0361da8
- Anyone running Linux 4.8

## Description

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

mm: vmscan: account for free pages to prevent infinite Loop in throttle\_direct\_reclaim()

The task sometimes continues looping in throttle\_direct\_reclaim() because
allow\_direct\_reclaim(pgdat) keeps returning false.  

 \#0 \[ffff80002cb6f8d0\] \_\_switch\_to at ffff8000080095ac
 \#1 \[ffff80002cb6f900\] \_\_schedule at ffff800008abbd1c
 \#2 \[ffff80002cb6f990\] schedule at ffff800008abc50c
 \#3 \[ffff80002cb6f9b0\] throttle\_direct\_reclaim at ffff800008273550
 \#4 \[ffff80002cb6fa20\] try\_to\_free\_pages at ffff800008277b68
 \#5 \[ffff80002cb6fae0\] \_\_alloc\_pages\_nodemask at ffff8000082c4660
 \#6 \[ffff80002cb6fc50\] alloc\_pages\_vma at ffff8000082e4a98
 \#7 \[ffff80002cb6fca0\] do\_anonymous\_page at ffff80000829f5a8
 \#8 \[ffff80002cb6fce0\] \_\_handle\_mm\_fault at ffff8000082a5974
 \#9 \[ffff80002cb6fd90\] handle\_mm\_fault at ffff8000082a5bd4

At this point, the pgdat contains the following two zones:

        NODE: 4  ZONE: 0  ADDR: ffff00817fffe540  NAME: "DMA32"
          SIZE: 20480  MIN/LOW/HIGH: 11/28/45
          VM\_STAT:
                NR\_FREE\_PAGES: 359
        NR\_ZONE\_INACTIVE\_ANON: 18813
          NR\_ZONE\_ACTIVE\_ANON: 0
        NR\_ZONE\_INACTIVE\_FILE: 50
          NR\_ZONE\_ACTIVE\_FILE: 0
          NR\_ZONE\_UNEVICTABLE: 0
        NR\_ZONE\_WRITE\_PENDING: 0
                     NR\_MLOCK: 0
                    NR\_BOUNCE: 0
                   NR\_ZSPAGES: 0
            NR\_FREE\_CMA\_PAGES: 0

        NODE: 4  ZONE: 1  ADDR: ffff00817fffec00  NAME: "Normal"
          SIZE: 8454144  PRESENT: 98304  MIN/LOW/HIGH: 68/166/264
          VM\_STAT:
                NR\_FREE\_PAGES: 146
        NR\_ZONE\_INACTIVE\_ANON: 94668
          NR\_ZONE\_ACTIVE\_ANON: 3
        NR\_ZONE\_INACTIVE\_FILE: 735
          NR\_ZONE\_ACTIVE\_FILE: 78
          NR\_ZONE\_UNEVICTABLE: 0
        NR\_ZONE\_WRITE\_PENDING: 0
                     NR\_MLOCK: 0
                    NR\_BOUNCE: 0
                   NR\_ZSPAGES: 0
            NR\_FREE\_CMA\_PAGES: 0

In allow\_direct\_reclaim(), while processing ZONE\_DMA32, the sum of
inactive/active file-backed pages calculated in zone\_reclaimable\_pages()
based on the result of zone\_page\_state\_snapshot() is zero.  

Additionally, since this system lacks swap, the calculation of inactive/
active anonymous pages is skipped.

        crash\> p nr\_swap\_pages
        nr\_swap\_pages = $1937 = {
          counter = 0
        }

As a result, ZONE\_DMA32 is deemed unreclaimable and skipped, moving on to
the processing of the next zone, ZONE\_NORMAL, despite ZONE\_DMA32 having
free pages significantly exceeding the high watermark.

The problem is that the pgdat-\>kswapd\_failures hasn't been incremented.

        crash\> px ((struct pglist\_data \*) 0xffff00817fffe540)-\>kswapd\_failures
        $1935 = 0x0

This is because the node deemed balanced.  The node balancing logic in
balance\_pgdat() evaluates all zones collectively.  If one or more zones
(e.g., ZONE\_DMA32) have enough free pages to meet their watermarks, the
entire node is deemed balanced.  This causes balance\_pgdat() to exit early
before incrementing the kswapd\_failures, as it considers the overall
memory state acceptable, even though some zones (like ZONE\_NORMAL) remain
under significant pressure.


The patch ensures that zone\_reclaimable\_pages() includes free pages
(NR\_FREE\_PAGES) in its calculation when no other reclaimable pages are
available (e.g., file-backed or anonymous pages).  This change prevents
zones like ZONE\_DMA32, which have sufficient free pages, from being
mistakenly deemed unreclaimable.  By doing so, the patch ensures proper
node balancing, avoids masking pressure on other zones like ZONE\_NORMAL,
and prevents infinite loops in throttle\_direct\_reclaim() caused by
allow\_direct\_reclaim(pgdat) repeatedly returning false.


The kernel hangs due to a task stuck in throttle\_direct\_reclaim(), caused
by a node being incorrectly deemed balanced despite pressure in certain
zones, such as ZONE\_NORMAL.  This issue arises from
zone\_reclaimable\_pages
---truncated---

## Affected and fixed versions

- Linux: \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 66cd37660ec34ec444fe42f2277330ae4a36bb19; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< d675fefbaec3815b3ae0af1bebd97f27df3a05c8; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 63eac98d6f0898229f515cb62fe4e4db2430e99c; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< bfb701192129803191c9cd6cdd1f82cd07f8de2c; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 1ff2302e8aeac7f2eedb551d7a89617283b5c6b2; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 58d0d02dbc67438fc80223fdd7bbc49cf0733284; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 6aaced5abd32e2a57cd94fd64f824514d0361da8 (cvelist)
- Linux: 4.8 (cvelist)

## Mitigation

- Upgrade Linux to 6aaced5abd32e2a57cd94fd64f824514d0361da8 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-57884. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-57884.md
Affected: Linux >= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, < 66cd37660ec34ec444fe42f2277330ae4a36bb19; >= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, < d675fefbaec3815b3ae0af1bebd97f27df3a05c8; >= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, < 63eac98d6f0898229f515cb62fe4e4db2430e99c; >= 5a1c84b404a7176b8b36e2a…
Fixed in: Linux 66cd37660ec34ec444fe42f2277330ae4a36bb19, Linux 63eac98d6f0898229f515cb62fe4e4db2430e99c, Linux 1ff2302e8aeac7f2eedb551d7a89617283b5c6b2, Linux 58d0d02dbc67438fc80223fdd7bbc49cf0733284, Linux 6aaced5abd32e2a57cd94fd64f824514d0361da8

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-57884 being exploited?

There is no confirmed exploitation: CVE-2024-57884 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-57884?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-57884?

Linux \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 66cd37660ec34ec444fe42f2277330ae4a36bb19; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< d675fefbaec3815b3ae0af1bebd97f27df3a05c8; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 63eac98d6f0898229f515cb62fe4e4db2430e99c; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< bfb701192129803191c9cd6cdd1f82cd07f8de2c; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 1ff2302e8aeac7f2eedb551d7a89617283b5c6b2; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 58d0d02dbc67438fc80223fdd7bbc49cf0733284; \>= 5a1c84b404a7176b8b36e2a0041b6f0adb3151a3, \< 6aaced5abd32e2a57cd94fd64f824514d0361da8; Linux 4.8.

### Is there a fix for CVE-2024-57884?

Yes. Fixed in Linux 66cd37660ec34ec444fe42f2277330ae4a36bb19, Linux 63eac98d6f0898229f515cb62fe4e4db2430e99c, Linux 1ff2302e8aeac7f2eedb551d7a89617283b5c6b2, Linux 58d0d02dbc67438fc80223fdd7bbc49cf0733284, Linux 6aaced5abd32e2a57cd94fd64f824514d0361da8. Upgrade Linux to 6aaced5abd32e2a57cd94fd64f824514d0361da8 or later.

### How do I check if I'm affected by CVE-2024-57884?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/66cd37660ec34ec444fe42f2277330ae4a36bb19>
- patch: <https://git.kernel.org/stable/c/d675fefbaec3815b3ae0af1bebd97f27df3a05c8>
- patch: <https://git.kernel.org/stable/c/63eac98d6f0898229f515cb62fe4e4db2430e99c>
- patch: <https://git.kernel.org/stable/c/bfb701192129803191c9cd6cdd1f82cd07f8de2c>
- patch: <https://git.kernel.org/stable/c/1ff2302e8aeac7f2eedb551d7a89617283b5c6b2>
- patch: <https://git.kernel.org/stable/c/58d0d02dbc67438fc80223fdd7bbc49cf0733284>
- patch: <https://git.kernel.org/stable/c/6aaced5abd32e2a57cd94fd64f824514d0361da8>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-57884>

HTML: <https://flawdb.com/CVE-2024-57884> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-57884>
