{"id":"CVE-2026-31652","aliases":["CVE-2026-31652"],"related":[],"kind":"vulnerability","state":"published","title":"mm/damon/stat: deallocate damon_call() failure leaking damon_ctx","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/stat: deallocate damon_call() failure leaking damon_ctx\n\ndamon_stat_start() always allocates the module's damon_ctx object\n(damon_stat_context).  Meanwhile, if damon_call() in the function fails,\nthe damon_ctx object is not deallocated.  Hence, if the damon_call() is\nfailed, and the user writes Y to “enabled” again, the previously\nallocated damon_ctx object is leaked.\n\nThis cannot simply be fixed by deallocating the damon_ctx object when\ndamon_call() fails.  That's because damon_call() failure doesn't guarantee\nthe kdamond main function, which accesses the damon_ctx object, is\ncompletely finished.  In other words, if damon_stat_start() deallocates\nthe damon_ctx object after damon_call() failure, the not-yet-terminated\nkdamond could access the freed memory (use-after-free).\n\nFix the leak while avoiding the use-after-free by keeping returning\ndamon_stat_start() without deallocating the damon_ctx object after\ndamon_call() failure, but deallocating it when the function is invoked\nagain and the kdamond is completely terminated.  If the kdamond is not yet\nterminated, simply return -EAGAIN, as the kdamond will soon be terminated.\n\nThe issue was discovered [1] by sashiko.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/stat: deallocate damon_call() failure leaking damon_ctx\n\ndamon_stat_start() always allocates the module's damon_ctx object\n(damon_stat_context).  Meanwhile, if damon_call() in the function fails,\nthe damon_ctx object is not deallocated.  Hence, if the damon_call() is\nfailed, and the user writes Y to “enabled” again, the previously\nallocated damon_ctx object is leaked.\n\nThis cannot simply be fixed by deallocating the damon_ctx object when\ndamon_call() fails.  That's because damon_call() failure doesn't guarantee\nthe kdamond main function, which accesses the damon_ctx object, is\ncompletely finished.  In other words, if damon_stat_start() deallocates\nthe damon_ctx object after damon_call() failure, the not-yet-terminated\nkdamond could access the freed memory (use-after-free).\n\nFix the leak while avoiding the use-after-free by keeping returning\ndamon_stat_start() without deallocating the damon_ctx object after\ndamon_call() failure, but deallocating it when the function is invoked\nagain and the kdamond is completely terminated.  If the kdamond is not yet\nterminated, simply return -EAGAIN, as the kdamond will soon be terminated.\n\nThe issue was discovered [1] by sashiko.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nmm/damon/stat: desasignar el damon_ctx que se fuga por fallo de damon_call()\n\ndamon_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.\n\nEsto 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).\n\nCorregir 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.\n\nEl problema fue descubierto [1] por sashiko.","source":"nvd"}],"published":"2026-04-24T14:45:04.930Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8","fixed":"447f8870b484f6596d7a7130e72bd0a3f1e037bb","status":"affected"},{"type":"git","introduced":"405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8","fixed":"16c92e9bf55fa049ddb5e894dc0623dacd46a620","status":"affected"},{"type":"git","introduced":"405f61996d9d2e9d497cd9f6b66f41dc28d3d1d8","fixed":"4c04c6b47c361612b1d70cec8f7a60b1482d1400","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.17","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.17","status":"unaffected"},{"type":"semver","introduced":"6.18.23","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.13","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.17.1","fixed":"6.18.23"},{"status":"affected","introduced":"6.19","fixed":"6.19.13"},{"status":"affected","version":"6.17"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/447f8870b484f6596d7a7130e72bd0a3f1e037bb","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/16c92e9bf55fa049ddb5e894dc0623dacd46a620","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4c04c6b47c361612b1d70cec8f7a60b1482d1400","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31652","url":"https://www.cve.org/CVERecord?id=CVE-2026-31652","licence":"CVE Terms of Use","modified":"2026-05-11T22:12:57.491Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31652","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31652","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.534Z","epss":{"score":0.0012,"percentile":0.01984,"date":"2026-12-01T12:00:22.000Z"}}