# CVE-2024-42316: mm/mglru: fix div-by-zero in vmpressure_calc_level()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 11% of CVEs (2026-12-01)
- Published: 2024-08-17T09:09:24.694Z
- Modified: 2026-06-17T07:49:14.770Z
- Weaknesses: CWE-369
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

mm/mglru: fix div-by-zero in vmpressure_calc_level()

evict_folios() uses a second pass to reclaim folios that have gone through
page writeback and become clean before it finishes the first pass, since
folio_rotate_reclaimable() cannot handle those folios due to the
isolation.

The second pass tries to avoid potential double counting by deducting
scan_control->nr_scanned.  However, this can result in underflow of
nr_scanned, under a condition where shrink_folio_list() does not increment
nr_scanned, i.e., when folio_trylock() fails.

The underflow can cause the divisor, i.e., scale=scanned+reclaimed in
vmpressure_calc_level(), to become zero, resulting in the following crash:

  [exception RIP: vmpressure_work_fn+101]
  process_one_work at ffffffffa3313f2b

Since scan_control->nr_scanned has no established semantics, the potential
double counting has minimal risks.  Therefore, fix the problem by not
deducting scan_control->nr_scanned in evict_folios().

(As written by CVE List.)

## Affected

- Linux Linux: from 359a5e1416caaf9ce28396a65ed3e386cc5de663 before 8de7bf77f21068a5f602bb1e59adbc5ab533509d; from 359a5e1416caaf9ce28396a65ed3e386cc5de663 before d6510f234c7d117790397f9bb150816b0a954a04; from 359a5e1416caaf9ce28396a65ed3e386cc5de663 before a39e38be632f0e1c908d70d1c9cd071c03faf895; from 359a5e1416caaf9ce28396a65ed3e386cc5de663 before 8b671fe1a879923ecfb72dda6caf01460dd885ef; 6.1 (not affected: before 6.1; from 6.1.103 up to 6.1.*; from 6.6.44 up to 6.6.*; from 6.10.3 up to 6.10.*; from 6.11 up to *)
- linux linux_kernel: from 6.1 before 6.1.103; from 6.2 before 6.6.44; from 6.7 before 6.10.3

## References

- <https://git.kernel.org/stable/c/8de7bf77f21068a5f602bb1e59adbc5ab533509d> (patch)
- <https://git.kernel.org/stable/c/d6510f234c7d117790397f9bb150816b0a954a04> (patch)
- <https://git.kernel.org/stable/c/a39e38be632f0e1c908d70d1c9cd071c03faf895> (patch)
- <https://git.kernel.org/stable/c/8b671fe1a879923ecfb72dda6caf01460dd885ef> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## Sources

- CVE List: [CVE-2024-42316](https://www.cve.org/CVERecord?id=CVE-2024-42316), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2024-42316](https://nvd.nist.gov/vuln/detail/CVE-2024-42316), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-42316 · Whole record: https://cve.day/CVE-2024-42316.json · Rebuilt by cve.day 2026-11-25T22:58:44.482Z
