HIGH
mm/damon CallControl UAF
CVE-2026-23012
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: mm/damon/core: remove call_control in inactive contexts If damon_call() is executed against a DAMON context that is not running, the function returns error while keeping the damon_call_control object linked to the context's call_controls list. Let's suppose the object is deallocated after the damon_call(), and yet another damon_call() is executed against the same context. The function tries to add the new damon_call_control object to the call_controls list, which still has the pointer to the previous damon_call_control object, which is deallocated. As a result, use-after-free happens. This can actually be triggered using the DAMON sysfs interface. It is not easily exploitable since it requires the sysfs write permission and making a definitely weird file writes, though. Please refer to the report for more details about the issue reproduction steps. Fix the issue by making two changes. Firstly, move the final kdamond_call() for cancelling all existing damon_call() requests from terminating DAMON context to be done before the ctx->kdamond reset. This makes any code that sees NULL ctx->kdamond can safely assume the context may not access damon_call() requests anymore. Secondly, let damon_call() to cleanup the damon_call_control objects that were added to the already-terminated DAMON context, before returning the error.
02KernelScan AI Analysis
Risk summary
This vulnerability allows local attackers with sysfs write permissions to trigger memory corruption through use-after-free conditions in the DAMON subsystem. While exploitation requires specific file system permissions and unusual write patterns, successful exploitation could lead to privilege escalation or system crashes.
Vulnerability analysis
Summary: Use-after-free vulnerability in DAMON (Data Access MONitor) subsystem when handling call control objects in inactive contexts
Root Cause: When damon_call() is executed against an inactive DAMON context, it returns an error while leaving the damon_call_control object linked to the context's call_controls list. If this object is deallocated and another damon_call() is made to the same context, the new call tries to add to a list that still contains a pointer to the freed object, causing use-after-free.
Attack Surface: Local attack surface requiring sysfs write permissions. Exploitable through the DAMON sysfs interface by making specific file writes to trigger the race condition between context termination and call control object management.
Fix Mechanism: Two-part fix: (1) Move the final kdamond_call() for cancelling existing requests to occur before ctx->kdamond reset during context termination, ensuring proper ordering. (2) Add damon_call_handle_inactive_ctx() function to cleanup damon_call_control objects that were added to already-terminated contexts before returning errors.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.18 | 6.18.7 | 23b061f421ee |
| mainline | 6.19 | f9132fbc2e83 |