CVE-2024-42316
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.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel-headers | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-libbpf-devel | Amazon Linux | 6.1.106-116.188.amzn2023 |
| kernel-livepatch-6.1.106-116.188 | Amazon Linux | 1.0-0.amzn2023 |
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 359a5e1416caaf9ce28396a65ed3e386cc5de663, 359a5e1416caaf9ce28396a65ed3e386cc5de663, 359a5e1416caaf9ce28396a65ed3e386cc5de663 |
| Linux | Linux | 6.1, 0, 6.1.103 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | kernel-livepatch-6.1.106-116.188 | 0 |
| linux | linux_kernel | 6.1, 6.1, 6.1 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | bpftool | 0 |
| Linux | Linux | 0, 359a5e1416caaf9ce28396a65ed3e386cc5de663, 359a5e1416caaf9ce28396a65ed3e386cc5de663 |
| amazon:2023 | kernel-tools-devel | 0 |
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