CVE-2026-74643: samples/damon/mtier: error out for zero quota goal target values
In the Linux kernel, the following vulnerability has been resolved:
samples/damon/mtier: error out for zero quota goal target values
Patch series "mm/damon: avoid division by zero from damosquotascore()".
DAMONSAMPLEMTIER and DAMONLRUSORT allow the user to trigger division by zero in damosquotascore(). Avoid it by adding parameters validation checks.
This patch (of 2):
damosquotascore() can trigger division by zero if the targetvalue is zero. DAMONSAMPLEMTIER lets users set the targetvalue via node0mem{used,free}bp parameters. It doesn't guard zero value case, though. As a result, users can trigger division by zero. Fix the issue by returning an error when the user tries to start DAMON with zero node0mem{used,free}bp parameter values.
DAMONSAMPLEMTIER is just a sample module, but the consequence is quite bad. Also the zero node0memfreebp parameter might look like a reasonable setup to some users. Hence, the issue might really happen in the real world.
One reliable way to reproduce the issue is like below:
# cd /sys/module/damonsamplemtier/parameters # echo 4096 > node0startaddr # echo 8192 > node0endaddr # echo 8192 > node1startaddr # echo 81920 > node1endaddr # echo 0 > node0memfreebp # echo Y > enabled # dmesg -w [...] [18792.235916] Oops: divide error: 0000 [#1] SMP NOPTI [...] [18792.242787] RIP: 0010:damosquotascore+0x6f/0x480 [...]
This issue was discovered [1] by Sashiko.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Configuration
Set node0_mem_used_bp and node0_mem_free_bp to non-zero values before starting DAMON; zero target values can trigger division by zero in damos_quota_score().
DAMON_SAMPLE_MTIER node0_mem_{used,free}_bp = non-zero
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the DAMON_SAMPLE_MTIER sample module are exposed when DAMON is started with a zero node0_mem_used_bp or node0_mem_free_bp parameter. The related patch series also identifies DAMON_LRU_SORT as allowing a user to trigger the same division-by-zero condition in damos_quota_score().
What is required to trigger the failure?
A user must configure a zero quota-goal target value. For DAMON_SAMPLE_MTIER, this can be done through the node0_mem_used_bp or node0_mem_free_bp module parameters before starting DAMON.
What can be done before the fix is available?
Do not start DAMON_SAMPLE_MTIER with node0_mem_used_bp or node0_mem_free_bp set to zero. Validate those parameters are nonzero in any scripts or operational procedures that configure the sample module.
How can I identify a risky DAMON_SAMPLE_MTIER configuration?
Check the DAMON_SAMPLE_MTIER module parameter values under /sys/module/damon_sample_mtier/parameters. A value of zero for node0_mem_used_bp or node0_mem_free_bp is a configuration that can trigger the division by zero when DAMON is started.