CVE-2025-40228: mm/damon/sysfs: catch commit test ctx alloc failure
In the Linux kernel, the following vulnerability has been resolved:
mm/damon/sysfs: catch commit test ctx alloc failure
Patch series "mm/damon/sysfs: fix commit test damonctx [de]allocation".
DAMON sysfs interface dynamically allocates and uses a damonctx object for testing if given inputs for online DAMON parameters update is valid. The object is being used without an allocation failure check, and leaked when the test succeeds. Fix the two bugs.
This patch (of 2):
The damonctx for testing online DAMON parameters commit inputs is used without its allocation failure check. This could result in an invalid memory access. Fix it by directly returning an error when the allocation failed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel DAMON sysfs commit-test path, check damon_ctx allocation failure and immediately return an error; also release the dynamically allocated damon_ctx after the test to prevent the leak.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-40228?
The severity of CVE-2025-40228 is classified as medium due to potential memory allocation failures in the Linux kernel.
How do I fix CVE-2025-40228?
To fix CVE-2025-40228, update your Linux kernel to the latest version that includes the patch for this vulnerability.
What component is affected by CVE-2025-40228?
CVE-2025-40228 affects the DAMON sysfs interface within the Linux kernel.
When was CVE-2025-40228 identified?
CVE-2025-40228 was identified in 2025 as part of ongoing security assessments of the Linux kernel.
Are all Linux kernel versions vulnerable to CVE-2025-40228?
Not all Linux kernel versions are vulnerable; consult your specific version documentation for details on whether it is impacted.