{"id":"CVE-2024-42316","summary":"mm/mglru: fix div-by-zero in vmpressure_calc_level()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mglru: fix div-by-zero in vmpressure_calc_level()\n\nevict_folios() uses a second pass to reclaim folios that have gone through\npage writeback and become clean before it finishes the first pass, since\nfolio_rotate_reclaimable() cannot handle those folios due to the\nisolation.\n\nThe second pass tries to avoid potential double counting by deducting\nscan_control-\u003enr_scanned.  However, this can result in underflow of\nnr_scanned, under a condition where shrink_folio_list() does not increment\nnr_scanned, i.e., when folio_trylock() fails.\n\nThe underflow can cause the divisor, i.e., scale=scanned+reclaimed in\nvmpressure_calc_level(), to become zero, resulting in the following crash:\n\n  [exception RIP: vmpressure_work_fn+101]\n  process_one_work at ffffffffa3313f2b\n\nSince scan_control-\u003enr_scanned has no established semantics, the potential\ndouble counting has minimal risks.  Therefore, fix the problem by not\ndeducting scan_control-\u003enr_scanned in evict_folios().","modified":"2026-04-16T00:05:09.565115411Z","published":"2024-08-17T09:09:24.694Z","related":["SUSE-SU-2024:3194-1","SUSE-SU-2024:3195-1","SUSE-SU-2024:3383-1","SUSE-SU-2025:20044-1","SUSE-SU-2025:20047-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42316.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/8b671fe1a879923ecfb72dda6caf01460dd885ef"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8de7bf77f21068a5f602bb1e59adbc5ab533509d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a39e38be632f0e1c908d70d1c9cd071c03faf895"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d6510f234c7d117790397f9bb150816b0a954a04"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42316.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42316"},{"type":"PACKAGE","url":"https://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"}}],"schema_version":"1.7.5"}