{"id":"CVE-2026-43388","aliases":["CVE-2026-43388"],"related":[],"kind":"vulnerability","state":"published","title":"mm/damon/core: clear walk_control on inactive context in damos_walk()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/core: clear walk_control on inactive context in damos_walk()\n\ndamos_walk() sets ctx->walk_control to the caller-provided control\nstructure before checking whether the context is running.  If the context\nis inactive (damon_is_running() returns false), the function returns\n-EINVAL without clearing ctx->walk_control.  This leaves a dangling\npointer to a stack-allocated structure that will be freed when the caller\nreturns.\n\nThis is structurally identical to the bug fixed in commit f9132fbc2e83\n(\"mm/damon/core: remove call_control in inactive contexts\") for\ndamon_call(), which had the same pattern of linking a control object and\nreturning an error without unlinking it.\n\nThe dangling walk_control pointer can cause:\n1. Use-after-free if the context is later started and kdamond\n   dereferences ctx->walk_control (e.g., in damos_walk_cancel()\n   which writes to control->canceled and calls complete())\n2. Permanent -EBUSY from subsequent damos_walk() calls, since the\n   stale pointer is non-NULL\n\nNonetheless, the real user impact is quite restrictive.  The\nuse-after-free is impossible because there is no damos_walk() callers who\nstarts the context later.  The permanent -EBUSY can actually confuse\nusers, as DAMON is not running.  But the symptom is kept only while the\ncontext is turned off.  Turning it on again will make DAMON internally\nuses a newly generated damon_ctx object that doesn't have the invalid\ndamos_walk_control pointer, so everything will work fine again.\n\nFix this by clearing ctx->walk_control under walk_control_lock before\nreturning -EINVAL, mirroring the fix pattern from f9132fbc2e83.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/core: clear walk_control on inactive context in damos_walk()\n\ndamos_walk() sets ctx->walk_control to the caller-provided control\nstructure before checking whether the context is running.  If the context\nis inactive (damon_is_running() returns false), the function returns\n-EINVAL without clearing ctx->walk_control.  This leaves a dangling\npointer to a stack-allocated structure that will be freed when the caller\nreturns.\n\nThis is structurally identical to the bug fixed in commit f9132fbc2e83\n(\"mm/damon/core: remove call_control in inactive contexts\") for\ndamon_call(), which had the same pattern of linking a control object and\nreturning an error without unlinking it.\n\nThe dangling walk_control pointer can cause:\n1. Use-after-free if the context is later started and kdamond\n   dereferences ctx->walk_control (e.g., in damos_walk_cancel()\n   which writes to control->canceled and calls complete())\n2. Permanent -EBUSY from subsequent damos_walk() calls, since the\n   stale pointer is non-NULL\n\nNonetheless, the real user impact is quite restrictive.  The\nuse-after-free is impossible because there is no damos_walk() callers who\nstarts the context later.  The permanent -EBUSY can actually confuse\nusers, as DAMON is not running.  But the symptom is kept only while the\ncontext is turned off.  Turning it on again will make DAMON internally\nuses a newly generated damon_ctx object that doesn't have the invalid\ndamos_walk_control pointer, so everything will work fine again.\n\nFix this by clearing ctx->walk_control under walk_control_lock before\nreturning -EINVAL, mirroring the fix pattern from f9132fbc2e83.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nmm/damon/core: limpiar walk_control en contexto inactivo en damos_walk()\n\ndamos_walk() establece ctx  ->  walk_control a la estructura de control proporcionada por el llamador antes de verificar si el contexto está en ejecución. Si el contexto está inactivo (damon_is_running() devuelve falso), la función devuelve -EINVAL sin limpiar ctx  ->  walk_control. Esto deja un puntero colgante a una estructura asignada en la pila que será liberada cuando el llamador regrese.\n\nEsto es estructuralmente idéntico al error corregido en el commit f9132fbc2e83 (’mm/damon/core: eliminar call_control en contextos inactivos’) para damon_call(), que tenía el mismo patrón de vincular un objeto de control y devolver un error sin desvincularlo.\n\nEl puntero colgante walk_control puede causar:\n1. Uso después de liberación si el contexto se inicia más tarde y kdamond desreferencia ctx  ->  walk_control (por ejemplo, en damos_walk_cancel() que escribe en control  ->  canceled y llama a complete())\n2. -EBUSY permanente de llamadas posteriores a damos_walk(), ya que el puntero obsoleto no es nulo\n\nNo obstante, el impacto real para el usuario es bastante restrictivo. El uso después de liberación es imposible porque no hay llamadores de damos_walk() que inicien el contexto más tarde. El -EBUSY permanente puede de hecho confundir a los usuarios, ya que DAMON no está en ejecución. Pero el síntoma se mantiene solo mientras el contexto está desactivado. Volver a activarlo hará que DAMON use internamente un objeto damon_ctx recién generado que no tiene el puntero damos_walk_control inválido, por lo que todo volverá a funcionar correctamente.\n\nSolucione esto limpiando ctx  ->  walk_control bajo walk_control_lock antes de devolver -EINVAL, replicando el patrón de corrección de f9132fbc2e83.","source":"nvd"}],"published":"2026-05-08T14:21:33.966Z","modified":"2026-11-11T20:10:00.273Z","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":"bf0eaba0ff9c9c8e6fd58ddfa1a8b6df4b813f61","fixed":"ce0aa47c963b8c3e5beace89e2b5a665a64b5b6b","status":"affected"},{"type":"git","introduced":"bf0eaba0ff9c9c8e6fd58ddfa1a8b6df4b813f61","fixed":"9320c77134ab8d7701e20608bbf08517df4fa321","status":"affected"},{"type":"git","introduced":"bf0eaba0ff9c9c8e6fd58ddfa1a8b6df4b813f61","fixed":"d210fdcac9c0d1380eab448aebc93f602c1cd4e6","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.14","status":"unaffected"},{"type":"semver","introduced":"6.18.19","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.9","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.14","fixed":"6.18.19"},{"status":"affected","introduced":"6.19","fixed":"6.19.9"},{"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/ce0aa47c963b8c3e5beace89e2b5a665a64b5b6b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9320c77134ab8d7701e20608bbf08517df4fa321","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d210fdcac9c0d1380eab448aebc93f602c1cd4e6","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43388","url":"https://www.cve.org/CVERecord?id=CVE-2026-43388","licence":"CVE Terms of Use","modified":"2026-05-11T22:23:37.300Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43388","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43388","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"}],"updatedAt":"2026-11-25T22:59:21.042Z","epss":{"score":0.00168,"percentile":0.03513,"date":"2026-11-30T12:00:22.000Z"}}