CVE-2024-42316: mm/mglru: fix div-by-zero in vmpressure_calc_level()
In the Linux kernel, the following vulnerability has been resolved:
mm/mglru: fix div-by-zero in vmpressurecalclevel()
evictfolios() uses a second pass to reclaim folios that have gone through page writeback and become clean before it finishes the first pass, since foliorotatereclaimable() cannot handle those folios due to the isolation.
The second pass tries to avoid potential double counting by deducting scancontrol->nrscanned. However, this can result in underflow of nrscanned, under a condition where shrinkfoliolist() does not increment nrscanned, i.e., when foliotrylock() fails.
The underflow can cause the divisor, i.e., scale=scanned+reclaimed in vmpressurecalclevel(), to become zero, resulting in the following crash:
[exception RIP: vmpressureworkfn+101] processonework at ffffffffa3313f2b
Since scancontrol->nrscanned has no established semantics, the potential double counting has minimal risks. Therefore, fix the problem by not deducting scancontrol->nrscanned in evictfolios().
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-42316?
CVE-2024-42316 has a medium severity rating due to the potential impact on system stability and reliability.
How do I fix CVE-2024-42316?
To fix CVE-2024-42316, you should update to a patched version of the Linux kernel that resolves the vulnerability.
What versions of the Linux kernel are affected by CVE-2024-42316?
Versions of the Linux kernel between 6.1 and 6.6 are affected by CVE-2024-42316.
What potential impact does CVE-2024-42316 have on my system?
CVE-2024-42316 could lead to a division by zero error, which may result in system instability during memory pressure conditions.
Is there a known exploit for CVE-2024-42316?
Currently, there are no public exploits reported for CVE-2024-42316, but it is important to apply updates to mitigate any risk.