{"id":"CVE-2026-31445","aliases":["CVE-2026-31445"],"related":[],"kind":"vulnerability","state":"published","title":"mm/damon/core: avoid use of half-online-committed context","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/core: avoid use of half-online-committed context\n\nOne major usage of damon_call() is online DAMON parameters update.  It is\ndone by calling damon_commit_ctx() inside the damon_call() callback\nfunction.  damon_commit_ctx() can fail for two reasons: 1) invalid\nparameters and 2) internal memory allocation failures.  In case of\nfailures, the damon_ctx that attempted to be updated (commit destination)\ncan be partially updated (or, corrupted from a perspective), and therefore\nshouldn't be used anymore.  The function only ensures the damon_ctx object\ncan safely deallocated using damon_destroy_ctx().\n\nThe API callers are, however, calling damon_commit_ctx() only after\nasserting the parameters are valid, to avoid damon_commit_ctx() fails due\nto invalid input parameters.  But it can still theoretically fail if the\ninternal memory allocation fails.  In the case, DAMON may run with the\npartially updated damon_ctx.  This can result in unexpected behaviors\nincluding even NULL pointer dereference in case of damos_commit_dests()\nfailure [1].  Such allocation failure is arguably too small to fail, so\nthe real world impact would be rare.  But, given the bad consequence, this\nneeds to be fixed.\n\nAvoid such partially-committed (maybe-corrupted) damon_ctx use by saving\nthe damon_commit_ctx() failure on the damon_ctx object.  For this,\nintroduce damon_ctx->maybe_corrupted field.  damon_commit_ctx() sets it\nwhen it is failed.  kdamond_call() checks if the field is set after each\ndamon_call_control->fn() is executed.  If it is set, ignore remaining\ncallback requests and return.  All kdamond_call() callers including\nkdamond_fn() also check the maybe_corrupted field right after\nkdamond_call() invocations.  If the field is set, break the kdamond_fn()\nmain loop so that DAMON sill doesn't use the context that might be\ncorrupted.\n\n[sj@kernel.org: let kdamond_call() with cancel regardless of maybe_corrupted]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/core: avoid use of half-online-committed context\n\nOne major usage of damon_call() is online DAMON parameters update.  It is\ndone by calling damon_commit_ctx() inside the damon_call() callback\nfunction.  damon_commit_ctx() can fail for two reasons: 1) invalid\nparameters and 2) internal memory allocation failures.  In case of\nfailures, the damon_ctx that attempted to be updated (commit destination)\ncan be partially updated (or, corrupted from a perspective), and therefore\nshouldn't be used anymore.  The function only ensures the damon_ctx object\ncan safely deallocated using damon_destroy_ctx().\n\nThe API callers are, however, calling damon_commit_ctx() only after\nasserting the parameters are valid, to avoid damon_commit_ctx() fails due\nto invalid input parameters.  But it can still theoretically fail if the\ninternal memory allocation fails.  In the case, DAMON may run with the\npartially updated damon_ctx.  This can result in unexpected behaviors\nincluding even NULL pointer dereference in case of damos_commit_dests()\nfailure [1].  Such allocation failure is arguably too small to fail, so\nthe real world impact would be rare.  But, given the bad consequence, this\nneeds to be fixed.\n\nAvoid such partially-committed (maybe-corrupted) damon_ctx use by saving\nthe damon_commit_ctx() failure on the damon_ctx object.  For this,\nintroduce damon_ctx->maybe_corrupted field.  damon_commit_ctx() sets it\nwhen it is failed.  kdamond_call() checks if the field is set after each\ndamon_call_control->fn() is executed.  If it is set, ignore remaining\ncallback requests and return.  All kdamond_call() callers including\nkdamond_fn() also check the maybe_corrupted field right after\nkdamond_call() invocations.  If the field is set, break the kdamond_fn()\nmain loop so that DAMON sill doesn't use the context that might be\ncorrupted.\n\n[sj@kernel.org: let kdamond_call() with cancel regardless of maybe_corrupted]","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nmm/damon/core: evitar el uso de contexto medio-online-commitado\n\nUn uso principal de damon_call() es la actualización de parámetros DAMON en línea. Se realiza llamando a damon_commit_ctx() dentro de la función de callback damon_call(). damon_commit_ctx() puede fallar por dos razones: 1) parámetros inválidos y 2) fallos de asignación de memoria interna. En caso de fallos, el damon_ctx que intentó ser actualizado (destino de commit) puede ser parcialmente actualizado (o, corrompido desde una perspectiva), y por lo tanto no debería usarse más. La función solo asegura que el objeto damon_ctx puede ser desasignado de forma segura usando damon_destroy_ctx().\n\nLos llamadores de la API están, sin embargo, llamando a damon_commit_ctx() solo después de afirmar que los parámetros son válidos, para evitar que damon_commit_ctx() falle debido a parámetros de entrada inválidos. Pero aún puede fallar teóricamente si la asignación de memoria interna falla. En ese caso, DAMON puede ejecutarse con el damon_ctx parcialmente actualizado. Esto puede resultar en comportamientos inesperados, incluyendo incluso la desreferencia de puntero NULL en caso de fallo de damos_commit_dests() [1]. Tal fallo de asignación es, discutiblemente, demasiado pequeño para fallar, por lo que el impacto en el mundo real sería raro. Pero, dada la mala consecuencia, esto necesita ser arreglado.\n\nEvitar el uso de dicho damon_ctx parcialmente-commitado (quizás-corrompido) guardando el fallo de damon_commit_ctx() en el objeto damon_ctx. Para esto, se introduce el campo damon_ctx  ->  maybe_corrupted. damon_commit_ctx() lo establece cuando falla. kdamond_call() verifica si el campo está establecido después de que se ejecuta cada damon_call_control  ->  fn(). Si está establecido, ignorar las solicitudes de callback restantes y retornar. Todos los llamadores de kdamond_call(), incluyendo kdamond_fn(), también verifican el campo maybe_corrupted justo después de las invocaciones de kdamond_call(). Si el campo está establecido, romper el bucle principal de kdamond_fn() para que DAMON siga sin usar el contexto que podría estar corrompido.\n\n[sj@kernel.org: permitir kdamond_call() con cancelación independientemente de maybe_corrupted]","source":"nvd"}],"published":"2026-04-22T13:53:42.090Z","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:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"3301f1861d34f53911a30a8f5f41b9141bd8ed39","fixed":"9c495f9d3781cd692bd199531cabd4627155e8cd","status":"affected"},{"type":"git","introduced":"3301f1861d34f53911a30a8f5f41b9141bd8ed39","fixed":"1b247cd0654a3a306996fa80741d79296c683a56","status":"affected"},{"type":"git","introduced":"3301f1861d34f53911a30a8f5f41b9141bd8ed39","fixed":"26f775a054c3cda86ad465a64141894a90a9e145","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.15","status":"unaffected"},{"type":"semver","introduced":"6.18.21","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.11","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.15","fixed":"6.18.21"},{"status":"affected","introduced":"6.19","fixed":"6.19.11"},{"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/9c495f9d3781cd692bd199531cabd4627155e8cd","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1b247cd0654a3a306996fa80741d79296c683a56","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/26f775a054c3cda86ad465a64141894a90a9e145","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31445","url":"https://www.cve.org/CVERecord?id=CVE-2026-31445","licence":"CVE Terms of Use","modified":"2026-05-11T22:08:50.744Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31445","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31445","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.264Z","epss":{"score":0.00125,"percentile":0.02403,"date":"2026-12-01T12:00:22.000Z"}}