CVE-2026-43388
Received Received - Intake
Use-After-Free in Linux Kernel DAMON

Publication date: 2026-05-08

Last updated on: 2026-05-08

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: mm/damon/core: clear walk_control on inactive context in damos_walk() damos_walk() sets ctx->walk_control to the caller-provided control structure before checking whether the context is running. If the context is inactive (damon_is_running() returns false), the function returns -EINVAL without clearing ctx->walk_control. This leaves a dangling pointer to a stack-allocated structure that will be freed when the caller returns. This is structurally identical to the bug fixed in commit f9132fbc2e83 ("mm/damon/core: remove call_control in inactive contexts") for damon_call(), which had the same pattern of linking a control object and returning an error without unlinking it. The dangling walk_control pointer can cause: 1. Use-after-free if the context is later started and kdamond Β  Β dereferences ctx->walk_control (e.g., in damos_walk_cancel() Β  Β which writes to control->canceled and calls complete()) 2. Permanent -EBUSY from subsequent damos_walk() calls, since the Β  Β stale pointer is non-NULL Nonetheless, the real user impact is quite restrictive. The use-after-free is impossible because there is no damos_walk() callers who starts the context later. The permanent -EBUSY can actually confuse users, as DAMON is not running. But the symptom is kept only while the context is turned off. Turning it on again will make DAMON internally uses a newly generated damon_ctx object that doesn't have the invalid damos_walk_control pointer, so everything will work fine again. Fix this by clearing ctx->walk_control under walk_control_lock before returning -EINVAL, mirroring the fix pattern from f9132fbc2e83.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-08
Last Modified
2026-05-08
Generated
2026-05-09
AI Q&A
2026-05-08
EPSS Evaluated
N/A
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
linux linux_kernel *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The provided information does not specify any impact of this vulnerability on compliance with common standards and regulations such as GDPR or HIPAA.


Can you explain this vulnerability to me?

This vulnerability exists in the Linux kernel's DAMON subsystem, specifically in the function damos_walk(). The function sets a pointer called walk_control to a caller-provided control structure before checking if the context is active. If the context is inactive, the function returns an error (-EINVAL) but does not clear the walk_control pointer, leaving a dangling pointer to a stack-allocated structure that will be freed when the caller returns.

This dangling pointer can cause two issues: a use-after-free if the context is later started and the pointer is dereferenced, and a permanent -EBUSY error from subsequent calls to damos_walk() because the stale pointer is non-NULL. However, the use-after-free scenario is practically impossible because no callers start the context later, and the -EBUSY error only persists while the context is off.

The vulnerability was fixed by clearing the walk_control pointer before returning the error, preventing the dangling pointer issue.


How can this vulnerability impact me? :

The real user impact of this vulnerability is quite limited. The use-after-free condition is effectively impossible in practice because no callers restart the context after it becomes inactive.

The main impact is that subsequent calls to damos_walk() may return a permanent -EBUSY error, which can confuse users by indicating that DAMON is busy even when it is not running. This symptom only occurs while the context is turned off, and turning the context back on resets the internal state, resolving the issue.


What immediate steps should I take to mitigate this vulnerability?

The vulnerability is fixed by clearing the ctx->walk_control pointer under walk_control_lock before returning an error in damos_walk().

To mitigate this vulnerability immediately, you should update your Linux kernel to a version that includes this fix.

Additionally, if you encounter the symptom of permanent -EBUSY errors from damos_walk() calls while the context is inactive, turning the DAMON context on again will reset the internal damon_ctx object and clear the invalid pointer, restoring normal operation.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart