Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2025-39877

HIGH 7.8EPSS 9%

mm/damon/sysfs: fix use-after-free in state_show()

Mitigation

  • Upgrade Linux to 3260a3f0828e06f5f13fac69fb1999a6d60d9cff or later.

Who should check

  • Anyone running Linux >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 60d7a3d2b985a395318faa1d88da6915fad11c19; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 26d29b2ac87a2989071755f9828ebf839b560d4c; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 4e87f461d61959647464a94d11ae15c011be58ce; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3260a3f0828e06f5f13fac69fb1999a6d60d9cff
  • Anyone running Linux 5.18

Vulnerability facts

Affected
Linux >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 60d7a3d2b985a395318faa1d88da6915fad11c19; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 26d29b2ac87a2989071755f9828ebf839b560d4c; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 4e87f461d61959647464a94d11ae15c011be58ce; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3260a3f0828e06f5f13fac69fb1999a6d60d9cff; Linux 5.18
Fixed in
Linux 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e, Linux 60d7a3d2b985a395318faa1d88da6915fad11c19, Linux 26d29b2ac87a2989071755f9828ebf839b560d4c, Linux 4e87f461d61959647464a94d11ae15c011be58ce, Linux 3260a3f0828e06f5f13fac69fb1999a6d60d9cff
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
7.8 (v3.1, NVD)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
0.24% chance of exploitation in 30 days (percentile 9, 2026-11-26)
CWE
CWE-416
Published
Modified

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.

Affected and fixed versions

Package / productAffectedFixedSource
Linux>= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 60d7a3d2b985a395318faa1d88da6915fad11c19; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 26d29b2ac87a2989071755f9828ebf839b560d4c; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 4e87f461d61959647464a94d11ae15c011be58ce; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3260a3f0828e06f5f13fac69fb1999a6d60d9cff—cvelist
Linux5.18—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2025-39877. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-39877.md
Affected: Linux >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 60d7a3d2b985a395318faa1d88da6915fad11c19; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 26d29b2ac87a2989071755f9828ebf839b560d4c; >= a61ea561c87139992fe32af…
Fixed in: Linux 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e, Linux 60d7a3d2b985a395318faa1d88da6915fad11c19, Linux 26d29b2ac87a2989071755f9828ebf839b560d4c, Linux 4e87f461d61959647464a94d11ae15c011be58ce, Linux 3260a3f0828e06f5f13fac69fb1999a6d60d9cff

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2025-39877 being exploited?

There is no confirmed exploitation: CVE-2025-39877 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.24% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2025-39877?

High: CVSS 7.8 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

Which versions are affected by CVE-2025-39877?

Linux >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 60d7a3d2b985a395318faa1d88da6915fad11c19; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 26d29b2ac87a2989071755f9828ebf839b560d4c; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 4e87f461d61959647464a94d11ae15c011be58ce; >= a61ea561c87139992fe32afdee48a6f6b85d824a, < 3260a3f0828e06f5f13fac69fb1999a6d60d9cff; Linux 5.18.

Is there a fix for CVE-2025-39877?

Yes. Fixed in Linux 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e, Linux 60d7a3d2b985a395318faa1d88da6915fad11c19, Linux 26d29b2ac87a2989071755f9828ebf839b560d4c, Linux 4e87f461d61959647464a94d11ae15c011be58ce, Linux 3260a3f0828e06f5f13fac69fb1999a6d60d9cff. Upgrade Linux to 3260a3f0828e06f5f13fac69fb1999a6d60d9cff or later.

How do I check if I'm affected by CVE-2025-39877?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors