VDB

CVE-2024-42316

CVE-2024-42316 PUBLISHED

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

Reported by linux · Published August 17, 2024

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

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-headersAmazon Linux6.1.106-116.188.amzn2023
kernel-libbpf-develAmazon Linux6.1.106-116.188.amzn2023
kernel-livepatch-6.1.106-116.188Amazon Linux1.0-0.amzn2023

Affected products

VendorProductVersions
LinuxLinux359a5e1416caaf9ce28396a65ed3e386cc5de663, 359a5e1416caaf9ce28396a65ed3e386cc5de663, 359a5e1416caaf9ce28396a65ed3e386cc5de663
LinuxLinux6.1, 0, 6.1.103
amazon:2023kernel-headers0
amazon:2023kernel-libbpf-devel0
amazon:2023kernel-livepatch-6.1.106-116.1880
linuxlinux_kernel6.1, 6.1, 6.1
amazon:2023kernel-libbpf-static0
amazon:2023perf0
amazon:2023python3-perf0
amazon:2023kernel-modules-extra-common0
amazon:2023kernel-libbpf0
amazon:2023kernel-modules-extra0
amazon:2023kernel-tools0
amazon:2023kernel0
amazon:2023kernel-devel0
amazon:2023bpftool0
LinuxLinux0, 359a5e1416caaf9ce28396a65ed3e386cc5de663, 359a5e1416caaf9ce28396a65ed3e386cc5de663
amazon:2023kernel-tools-devel0

Timeline

  • Aug 17, 2024 CVE Published
  • Aug 18, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (6 in total, the first dated here)
  • Jan 6, 2025 CVE Updated
  • Dec 16, 2025 PoC Published
  • Jan 6, 2026 Security Advisory (136 in total, the first dated here)
  • Mar 30, 2026 Distribution Patch (122 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-42316
vulnetix vdb fixes CVE-2024-42316

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-42316/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›