{"id":"CVE-2024-42316","published":"2024-08-17T09:09:24Z","modified":"2026-05-11T20:30:05Z","title":"mm/mglru: fix div-by-zero in vmpressure_calc_level()","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"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->nr_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->nr_scanned has no established semantics, the potential\ndouble counting has minimal risks.  Therefore, fix the problem by not\ndeducting scan_control->nr_scanned in evict_folios().","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.0021,"percentile":0.11361,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/8de7bf77f21068a5f602bb1e59adbc5ab533509d","tags":[]},{"url":"https://git.kernel.org/stable/c/d6510f234c7d117790397f9bb150816b0a954a04","tags":[]},{"url":"https://git.kernel.org/stable/c/a39e38be632f0e1c908d70d1c9cd071c03faf895","tags":[]},{"url":"https://git.kernel.org/stable/c/8b671fe1a879923ecfb72dda6caf01460dd885ef","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","tags":[]}],"priority":{"score":2.3,"factors":[{"name":"EPSS percentile","points":2.27}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 359a5e1416caaf9ce28396a65ed3e386cc5de663, < 8de7bf77f21068a5f602bb1e59adbc5ab533509d",">= 359a5e1416caaf9ce28396a65ed3e386cc5de663, < d6510f234c7d117790397f9bb150816b0a954a04",">= 359a5e1416caaf9ce28396a65ed3e386cc5de663, < a39e38be632f0e1c908d70d1c9cd071c03faf895",">= 359a5e1416caaf9ce28396a65ed3e386cc5de663, < 8b671fe1a879923ecfb72dda6caf01460dd885ef"]},{"vendor":"Linux","product":"Linux","versions":["6.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-10T16:09:42.817559Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2024-39534","exploited":false,"provenance":"source"}}