Skip to contentSkip to conversation

CVE-2026-68164: mm/damon/core: disallow overlapping input ranges for damon_set_regions()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Aug 10

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

mm/damon/core: disallow overlapping input ranges for damon_set_regions()

damon_set_regions() assumes the input ranges are sorted by the address and don't overlap each other. Hence the assumption was initially to be explicitly validated. But commit 97d482f4592f ("mm/damon/sysfs: reuse damon_set_regions() for regions setting") has mistakenly removed the validation.

This can make DAMON behave in unexpected ways. At the best, the monitoring results snapshot will just look weird since there will be overlapping regions. DAMOS will also work weirdly, applying the same action multiple times for overlapping regions, and make DAMOS quota weird. More seriously, depending on the setup and regions updates sequence, negative size regions can be made. It will trigger WARN_ONCE() if the kernel is built with CONFIG_DAMON_DEBUG_SANITY=y. Depending on the monitoring results, the negative size region can further trigger division by zero in damon_merge_two_regions().

Note that some of the consequences including the WARN_ONCE() and the divide by zero depend on commits that were introduced after the root cause commit 97d482f4592f ("mm/damon/sysfs: reuse damon_set_regions() for regions setting").

Fix the problems by checking the assumption and returning an error if the input ranges don't meet the assumption.

The issue was discovered [1] by Sashiko.

The Linux kernel CVE team has assigned CVE-2026-68164 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.19 with commit 97d482f4592fde2322c319f07bc54f3a0d37861c and fixed in 6.6.148 with commit 4b4a3e7ef7bb622237495db9ba4dfd7417d6530e
	Issue introduced in 5.19 with commit 97d482f4592fde2322c319f07bc54f3a0d37861c and fixed in 6.12.101 with commit 06a4beeeec8f03f0b3e9c78a98f1ae4f0f18cfbd
	Issue introduced in 5.19 with commit 97d482f4592fde2322c319f07bc54f3a0d37861c and fixed in 6.18.42 with commit 6ce0db97fb37ab8cf8596edca0e3de8618ab009a
	Issue introduced in 5.19 with commit 97d482f4592fde2322c319f07bc54f3a0d37861c and fixed in 7.1.6 with commit e33adf96afb5883f84b0d98747976bde293e33cb
	Issue introduced in 5.19 with commit 97d482f4592fde2322c319f07bc54f3a0d37861c and fixed in 7.2-rc5 with commit 954157679ec34661c2e87e7eb796104a797c32db

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-68164

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
mm/damon/core.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/4b4a3e7ef7bb622237495db9ba4dfd7417d6530e
	https://git.kernel.org/stable/c/06a4beeeec8f03f0b3e9c78a98f1ae4f0f18cfbd
	https://git.kernel.org/stable/c/6ce0db97fb37ab8cf8596edca0e3de8618ab009a
	https://git.kernel.org/stable/c/e33adf96afb5883f84b0d98747976bde293e33cb
	https://git.kernel.org/stable/c/954157679ec34661c2e87e7eb796104a797c32db