CVE-2026-31652
JSON

7.8high

mm/damon/stat: deallocate damon_call() failure leaking damon_ctx

Severity
7.8high CVSS:3.1 by NVD
Exploit likelihood
0.12% (higher than 1% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: mm/damon/stat: deallocate damon_call() failure leaking damon_ctx damon_stat_start() always allocates the module's damon_ctx object (damon_stat_context). Meanwhile, if damon_call() in the function fails, the damon_ctx object is not deallocated. Hence, if the damon_call() is failed, and the user writes Y to “enabled” again, the previously allocated damon_ctx object is leaked. This cannot simply be fixed by deallocating the damon_ctx object when damon_call() fails. That's because damon_call() failure doesn't guarantee the kdamond main function, which accesses the damon_ctx object, is completely finished. In other words, if damon_stat_start() deallocates the damon_ctx object after damon_call() failure, the not-yet-terminated kdamond could access the freed memory (use-after-free). Fix the leak while avoiding the use-after-free by keeping returning damon_stat_start() without deallocating the damon_ctx object after damon_call() failure, but deallocating it when the function is invoked again and the kdamond is completely terminated. If the kdamond is not yet terminated, simply return -EAGAIN, as the kdamond will soon be terminated. The issue was discovered [1] by sashiko.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8 before 447f8870b484f6596d7a7130e72bd0a3f1e037bb, from 405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8 before 16c92e9bf55fa049ddb5e894dc0623dacd46a620, from 405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8 before 4c04c6b47c361612b1d70cec8f7a60b1482d1400, 6.17
Not affected: before 6.17, from 6.18.23 up to 6.18.*, from 6.19.13 up to 6.19.*, from 7.0 up to *
CVE List
linux linux_kernelfrom 6.17.1 before 6.18.23, from 6.19 before 6.19.13, 6.17, 7.0NVD

Classification

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: mm/damon/stat: deallocate damon_call() failure leaking damon_ctx damon_stat_start() always allocates the module's damon_ctx object (damon_stat_context). Meanwhile, if damon_call() in the function fails, the damon_ctx object is not deallocated. Hence, if the damon_call() is failed, and the user writes Y to “enabled” again, the previously allocated damon_ctx object is leaked. This cannot simply be fixed by deallocating the damon_ctx object when damon_call() fails. That's because damon_call() failure doesn't guarantee the kdamond main function, which accesses the damon_ctx object, is completely finished. In other words, if damon_stat_start() deallocates the damon_ctx object after damon_call() failure, the not-yet-terminated kdamond could access the freed memory (use-after-free). Fix the leak while avoiding the use-after-free by keeping returning damon_stat_start() without deallocating the damon_ctx object after damon_call() failure, but deallocating it when the function is invoked again and the kdamond is completely terminated. If the kdamond is not yet terminated, simply return -EAGAIN, as the kdamond will soon be terminated. The issue was discovered [1] by sashiko.

NVD (es)

En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: mm/damon/stat: desasignar el damon_ctx que se fuga por fallo de damon_call() damon_stat_start() siempre asigna el objeto damon_ctx del módulo (damon_stat_context). Mientras tanto, si damon_call() en la función falla, el objeto damon_ctx no es desasignado. Por lo tanto, si damon_call() falla, y el usuario escribe Y en ’enabled’ de nuevo, el objeto damon_ctx previamente asignado se fuga. Esto no puede ser simplemente corregido desasignando el objeto damon_ctx cuando damon_call() falla. Esto se debe a que el fallo de damon_call() no garantiza que la función principal de kdamond, que accede al objeto damon_ctx, esté completamente terminada. En otras palabras, si damon_stat_start() desasigna el objeto damon_ctx después del fallo de damon_call(), el kdamond aún no terminado podría acceder a la memoria liberada (uso después de liberación). Corregir la fuga evitando el uso después de liberación, haciendo que damon_stat_start() siga retornando sin desasignar el objeto damon_ctx después del fallo de damon_call(), pero desasignándolo cuando la función es invocada de nuevo y el kdamond está completamente terminado. Si el kdamond aún no está terminado, simplemente retornar -EAGAIN, ya que el kdamond pronto será terminado. El problema fue descubierto [1] por sashiko.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-31652 changed 2026-05-11CVE Terms of Use
NVDCVE-2026-31652 changed 2026-11-11Public domain