CVE-2025-39877
mm/damon/sysfs: fix use-after-free in state_show()
Check your servers for CVE-2025-39877
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-39877 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
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.
Exploitation
EPSS 0.16%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 5.45% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 5 Nov 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from a61ea561c87139992fe32afdee48a6f6b85d824a, before 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e affected from a61ea561c87139992fe32afdee48a6f6b85d824a, before 60d7a3d2b985a395318faa1d88da6915fad11c19 affected from a61ea561c87139992fe32afdee48a6f6b85d824a, before 26d29b2ac87a2989071755f9828ebf839b560d4c affected from a61ea561c87139992fe32afdee48a6f6b85d824a, before 4e87f461d61959647464a94d11ae15c011be58ce affected from a61ea561c87139992fe32afdee48a6f6b85d824a, before 3260a3f0828e06f5f13fac69fb1999a6d60d9cff
Other versions: unaffected
|
| Linux |
affected 5.18 unaffected before 5.18 unaffected from 6.1.153 up to and including 6.1.* unaffected from 6.6.107 up to and including 6.6.* unaffected from 6.12.48 up to and including 6.12.* unaffected from 6.16.8 up to and including 6.16.* unaffected 6.17 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-39877 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-39877
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-39877
trivy image --scanners vuln IMAGE | grep CVE-2025-39877
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/3858c44341ad49dc7544b19cc9f9ecffaa7cc50e git.kernel.org
- https://git.kernel.org/stable/c/60d7a3d2b985a395318faa1d88da6915fad11c19 git.kernel.org
- https://git.kernel.org/stable/c/26d29b2ac87a2989071755f9828ebf839b560d4c git.kernel.org
- https://git.kernel.org/stable/c/4e87f461d61959647464a94d11ae15c011be58ce git.kernel.org
- https://git.kernel.org/stable/c/3260a3f0828e06f5f13fac69fb1999a6d60d9cff git.kernel.org
- https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html lists.debian.org
Source: the record CVE-2025-39877 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse