CVE-2024-42316

Source
https://cve.org/CVERecord?id=CVE-2024-42316
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-42316.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-42316
Downstream
Related
Published
2024-08-17T09:09:24.694Z
Modified
2026-03-11T07:47:12.855585Z
Summary
mm/mglru: fix div-by-zero in vmpressure_calc_level()
Details

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

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

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

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

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

[exception RIP: vmpressureworkfn+101] processonework at ffffffffa3313f2b

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

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42316.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
359a5e1416caaf9ce28396a65ed3e386cc5de663
Fixed
8de7bf77f21068a5f602bb1e59adbc5ab533509d
Fixed
d6510f234c7d117790397f9bb150816b0a954a04
Fixed
a39e38be632f0e1c908d70d1c9cd071c03faf895
Fixed
8b671fe1a879923ecfb72dda6caf01460dd885ef

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-42316.json"