CVE-2025-39877
mm/damon/sysfs: fix use-after-free in state_show()
Reported by linux · Published September 23, 2025
In the Linux kernel, the following vulnerability has been resolved: mm/damon/sysfs: fix use-after-free in state_show() state_show() reads kdamond->damon_ctx without holding damon_sysfs_lock. This allows a use-after-free race: CPU 0 CPU 1 ----- ----- state_show() damon_sysfs_turn_damon_on() ctx = kdamond->damon_ctx; mutex_lock(&damon_sysfs_lock); damon_destroy_ctx(kdamond->damon_ctx); kdamond->damon_ctx = NULL; mutex_unlock(&damon_sysfs_lock); damon_is_running(ctx); /* ctx is freed */ mutex_lock(&ctx->kdamond_lock); /* UAF */ (The race can also occur with damon_sysfs_kdamonds_rm_dirs() and damon_sysfs_kdamond_release(), which free or replace the context under damon_sysfs_lock.) Fix by taking damon_sysfs_lock before dereferencing the context, mirroring the locking used in pid_show(). The bug has existed since state_show() first accessed kdamond->damon_ctx.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel6.12-tools-devel | Amazon Linux | 1:6.12.48-67.114.amzn2023 |
| Linux | Linux | 60d7a3d2b985a395318faa1d88da6915fad11c19, 5.18, 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e |
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | a61ea561c87139992fe32afdee48a6f6b85d824a, a61ea561c87139992fe32afdee48a6f6b85d824a, a61ea561c87139992fe32afdee48a6f6b85d824a |
| Linux | Linux | 5.18, 0, 6.1.153 |
| amazon:2023 | kernel6.12-tools-devel | 0 |
| Linux | Linux | 6.17, 6.16.8, 6.12.48 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| linux | linux_kernel | 5.18, 5.18, 5.18 |
| amazon:2023 | kernel6.12-modules-extra | 0 |
| amazon:2023 | kernel6.12-libbpf-static | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2023 | kernel-livepatch-6.1.155-176.282 | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | kernel6.12-tools | 0 |
| amazon:2023 | kernel6.12-libbpf-devel | 0 |
| amazon:2023 | perf6.12 | 0 |
| amazon:2023 | python3-perf6.12 | 0 |
| amazon:2023 | kernel | 0 |
…and 12 more
Timeline
- Sep 22, 2025 CVE Published
- Sep 23, 2025 EPSS Score (30 in total, the first dated here)
- Oct 12, 2025 PoC Published (9 in total, the first dated here)
- Mar 29, 2026 Distribution Patch (68 in total, the first dated here)
- Mar 29, 2026 Security Advisory (79 in total, the first dated here)
- Jun 8, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2025-39877
vulnetix vdb fixes CVE-2025-39877
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-39877/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart