CVE-2026-90005: samples/damon/wsse: handle damon_start() failure
In the Linux kernel, the following vulnerability has been resolved:
samples/damon/wsse: handle damonstart() failure
Patch series "samples/damon: handle damon{start,stop}() failures".
All DAMON sample modules are not correctly handling failures from damonstart(). Among those, mtier also has an additional problem for handling of damonstop() failures. wsse and prcl also have a problem in their damoncall() failure handling. As a result, memory leaks, next DAMON operation disruptions, and use-after-free can happen. Fix those.
Note that only the damonstart() failure caused issues can reliably be reproduced. Reproducing those issues require the admin permission, though.
This patch (of 6):
damonsamplewssestart() callers assume it will clean up resources when it fails. And the function does the cleanup for context buildup failures. However, it is not doing the cleanup for damonstart() failure. As a result, when damonstart() fails, it leaks the memory for DAMON context. Free the context in case of the failure to fix the issues.
Note that the issue can reliably be reproduced because the module calls damonstart() in the exclusive mode. For example,
$ sudo damo start $ echo $$ | sudo tee /sys/module/damonsamplewsse/parameters/targetpid $ echo Y | sudo tee /sys/module/damonsamplewsse/parameters/enabled $ sudo cat /proc/allocinfo | grep damonnewctx
Because the first command is running another DAMON instance, the third command fails the damonstart() call because the new DAMON instance cannot exclusively run. And without this fix, by repeating the third and the fourth commands above, we can show the memory consumption is only increasing due to the leaks. It requires the sudo permission though.
The issue was discovered [1] by Sashiko.
Affected Software
Event History
Frequently Asked Questions
Who can reliably trigger the affected failure path?
Reproducing the damon_start() failure requires administrative permission. The wsse sample module invokes damon_start() in exclusive mode, making this failure path reliably reproducible when another DAMON operation conflicts with it.
What happens if the failure occurs?
A damon_start() failure in the wsse sample module can leave the allocated DAMON context unfreed, causing a memory leak. The broader affected sample-module failure handling can also lead to disruption of subsequent DAMON operations and use-after-free conditions.
What can be done if the fix cannot be applied immediately?
Restrict administrative access and avoid running the DAMON wsse sample module in situations where an exclusive-mode DAMON start can fail, such as when another DAMON operation is active.