{"id":"CVE-2024-42316","state":"PUBLISHED","title":"mm/mglru: fix div-by-zero in vmpressure_calc_level()","description":"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().","publishedAt":"2024-08-17T09:09:24.694Z","updatedAt":"2026-05-11T20:30:05.431Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"8de7bf77f21068a5f602bb1e59adbc5ab533509d","versionType":"git"},{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"d6510f234c7d117790397f9bb150816b0a954a04","versionType":"git"},{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"a39e38be632f0e1c908d70d1c9cd071c03faf895","versionType":"git"},{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"8b671fe1a879923ecfb72dda6caf01460dd885ef","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/vmscan.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.1","versionType":"semver"},{"version":"6.1.103","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.44","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.10.3","status":"unaffected","lessThanOrEqual":"6.10.*","versionType":"semver"},{"version":"6.11","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/vmscan.c"]}],"references":["https://git.kernel.org/stable/c/8de7bf77f21068a5f602bb1e59adbc5ab533509d","https://git.kernel.org/stable/c/d6510f234c7d117790397f9bb150816b0a954a04","https://git.kernel.org/stable/c/a39e38be632f0e1c908d70d1c9cd071c03faf895","https://git.kernel.org/stable/c/8b671fe1a879923ecfb72dda6caf01460dd885ef","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:47.831Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/42xxx/CVE-2024-42316.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-42316","state":"PUBLISHED","datePublished":"2024-08-17T09:09:24.694Z","dateUpdated":"2026-05-11T20:30:05.431Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-07-30T07:40:12.278Z"},"containers":{"cna":{"title":"mm/mglru: fix div-by-zero in vmpressure_calc_level()","descriptions":[{"lang":"en","value":"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()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"8de7bf77f21068a5f602bb1e59adbc5ab533509d","versionType":"git"},{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"d6510f234c7d117790397f9bb150816b0a954a04","versionType":"git"},{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"a39e38be632f0e1c908d70d1c9cd071c03faf895","versionType":"git"},{"version":"359a5e1416caaf9ce28396a65ed3e386cc5de663","status":"affected","lessThan":"8b671fe1a879923ecfb72dda6caf01460dd885ef","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/vmscan.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.1","versionType":"semver"},{"version":"6.1.103","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.44","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.10.3","status":"unaffected","lessThanOrEqual":"6.10.*","versionType":"semver"},{"version":"6.11","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/vmscan.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/8de7bf77f21068a5f602bb1e59adbc5ab533509d"},{"url":"https://git.kernel.org/stable/c/d6510f234c7d117790397f9bb150816b0a954a04"},{"url":"https://git.kernel.org/stable/c/a39e38be632f0e1c908d70d1c9cd071c03faf895"},{"url":"https://git.kernel.org/stable/c/8b671fe1a879923ecfb72dda6caf01460dd885ef"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T20:30:05.431Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.1.103"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.6.44"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.10.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.11"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-42316","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T16:09:42.817559Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-12T17:33:26.476Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T22:04:35.769Z"}}]}}}