Skip to content
Heist/ feed
Back to feed
UnratedFix available

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

Type: advisorySources: OSV

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().

Products
Kernel
Affected versions
Not specified
Fixed versions
6.1.103, 6.10.3, 6.6.44
CVEs
CVE-2024-42316
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 11:29 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 17 Aug 2024, 09:09 UTC

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().

osv:CVE-2024-42316

Kernel

Fixed versions: 6.1.103, 6.6.44, 6.10.3

Complete source record
{
  "id": "f5617a2777ed85df1d7568e329360d4b0e95b2b6de47b629a8e8b663aef6b8f5",
  "url": "https://osv.dev/vulnerability/CVE-2024-42316",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "mm/mglru: fix div-by-zero in vmpressure_calc_level()",
    "summary": "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().",
    "evidence": "osv:CVE-2024-42316",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.1.103",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.44",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.10.3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-42316",
      "aliases": [
        "CVE-2024-42316"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "359a5e1416caaf9ce28396a65ed3e386cc5de663"
                },
                {
                  "fixed": "8de7bf77f21068a5f602bb1e59adbc5ab533509d"
                },
                {
                  "fixed": "d6510f234c7d117790397f9bb150816b0a954a04"
                },
                {
                  "fixed": "a39e38be632f0e1c908d70d1c9cd071c03faf895"
                },
                {
                  "fixed": "8b671fe1a879923ecfb72dda6caf01460dd885ef"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-42316.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.1.0"
                },
                {
                  "fixed": "6.1.103"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.44"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.10.3"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-42316.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:50.708329619Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/8b671fe1a879923ecfb72dda6caf01460dd885ef",
        "https://git.kernel.org/stable/c/8de7bf77f21068a5f602bb1e59adbc5ab533509d",
        "https://git.kernel.org/stable/c/a39e38be632f0e1c908d70d1c9cd071c03faf895",
        "https://git.kernel.org/stable/c/d6510f234c7d117790397f9bb150816b0a954a04",
        "https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42316.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-42316",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42316.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-42316",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 519128,
  "published_at": "2024-08-17T09:09:24.694+00:00"
}