VDB

CVE-2025-39877

CVE-2025-39877 PUBLISHED

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.

PackageEcosystemFixed in
kernel6.12-tools-develAmazon Linux1:6.12.48-67.114.amzn2023
LinuxLinux60d7a3d2b985a395318faa1d88da6915fad11c19, 5.18, 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e

Affected products

VendorProductVersions
LinuxLinuxa61ea561c87139992fe32afdee48a6f6b85d824a, a61ea561c87139992fe32afdee48a6f6b85d824a, a61ea561c87139992fe32afdee48a6f6b85d824a
LinuxLinux5.18, 0, 6.1.153
amazon:2023kernel6.12-tools-devel0
LinuxLinux6.17, 6.16.8, 6.12.48
amazon:2023kernel-headers0
amazon:2023kernel-libbpf-devel0
linuxlinux_kernel5.18, 5.18, 5.18
amazon:2023kernel6.12-modules-extra0
amazon:2023kernel6.12-libbpf-static0
amazon:2023kernel-libbpf-static0
amazon:2023kernel-livepatch-6.1.155-176.2820
amazon:2023bpftool0
amazon:2023kernel-tools0
amazon:2023kernel-libbpf0
amazon:2023kernel-modules-extra0
amazon:2023kernel6.12-tools0
amazon:2023kernel6.12-libbpf-devel0
amazon:2023perf6.120
amazon:2023python3-perf6.120
amazon:2023kernel0

…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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›