GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

CVE-2025-39877 (GCVE-0-2025-39877)

Vulnerability from cvelistv5 – Published: 2025-09-23 06:00 – Updated: 2026-05-11 21:38
VLAI
Title
mm/damon/sysfs: fix use-after-free in state_show()
Summary
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.
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: a61ea561c87139992fe32afdee48a6f6b85d824a , < 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e (git)
Affected: a61ea561c87139992fe32afdee48a6f6b85d824a , < 60d7a3d2b985a395318faa1d88da6915fad11c19 (git)
Affected: a61ea561c87139992fe32afdee48a6f6b85d824a , < 26d29b2ac87a2989071755f9828ebf839b560d4c (git)
Affected: a61ea561c87139992fe32afdee48a6f6b85d824a , < 4e87f461d61959647464a94d11ae15c011be58ce (git)
Affected: a61ea561c87139992fe32afdee48a6f6b85d824a , < 3260a3f0828e06f5f13fac69fb1999a6d60d9cff (git)
guessed Create a notification for this product.
Linux Linux Affected: 5.18
Unaffected: 0 , < 5.18 (semver)
Unaffected: 6.1.153 , ≤ 6.1.* (semver)
Unaffected: 6.6.107 , ≤ 6.6.* (semver)
Unaffected: 6.12.48 , ≤ 6.12.* (semver)
Unaffected: 6.16.8 , ≤ 6.16.* (semver)
Unaffected: 6.17 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2025-11-03T17:44:22.015Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "mm/damon/sysfs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "3858c44341ad49dc7544b19cc9f9ecffaa7cc50e",
              "status": "affected",
              "version": "a61ea561c87139992fe32afdee48a6f6b85d824a",
              "versionType": "git"
            },
            {
              "lessThan": "60d7a3d2b985a395318faa1d88da6915fad11c19",
              "status": "affected",
              "version": "a61ea561c87139992fe32afdee48a6f6b85d824a",
              "versionType": "git"
            },
            {
              "lessThan": "26d29b2ac87a2989071755f9828ebf839b560d4c",
              "status": "affected",
              "version": "a61ea561c87139992fe32afdee48a6f6b85d824a",
              "versionType": "git"
            },
            {
              "lessThan": "4e87f461d61959647464a94d11ae15c011be58ce",
              "status": "affected",
              "version": "a61ea561c87139992fe32afdee48a6f6b85d824a",
              "versionType": "git"
            },
            {
              "lessThan": "3260a3f0828e06f5f13fac69fb1999a6d60d9cff",
              "status": "affected",
              "version": "a61ea561c87139992fe32afdee48a6f6b85d824a",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "mm/damon/sysfs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.18"
            },
            {
              "lessThan": "5.18",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.153",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.107",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.48",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.16.*",
              "status": "unaffected",
              "version": "6.16.8",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.17",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.153",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.107",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.48",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.16.8",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/damon/sysfs: fix use-after-free in state_show()\n\nstate_show() reads kdamond-\u003edamon_ctx without holding damon_sysfs_lock. \nThis allows a use-after-free race:\n\nCPU 0                         CPU 1\n-----                         -----\nstate_show()                  damon_sysfs_turn_damon_on()\nctx = kdamond-\u003edamon_ctx;     mutex_lock(\u0026damon_sysfs_lock);\n                              damon_destroy_ctx(kdamond-\u003edamon_ctx);\n                              kdamond-\u003edamon_ctx = NULL;\n                              mutex_unlock(\u0026damon_sysfs_lock);\ndamon_is_running(ctx);        /* ctx is freed */\nmutex_lock(\u0026ctx-\u003ekdamond_lock); /* UAF */\n\n(The race can also occur with damon_sysfs_kdamonds_rm_dirs() and\ndamon_sysfs_kdamond_release(), which free or replace the context under\ndamon_sysfs_lock.)\n\nFix by taking damon_sysfs_lock before dereferencing the context, mirroring\nthe locking used in pid_show().\n\nThe bug has existed since state_show() first accessed kdamond-\u003edamon_ctx."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-05-11T21:38:09.382Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/3858c44341ad49dc7544b19cc9f9ecffaa7cc50e"
        },
        {
          "url": "https://git.kernel.org/stable/c/60d7a3d2b985a395318faa1d88da6915fad11c19"
        },
        {
          "url": "https://git.kernel.org/stable/c/26d29b2ac87a2989071755f9828ebf839b560d4c"
        },
        {
          "url": "https://git.kernel.org/stable/c/4e87f461d61959647464a94d11ae15c011be58ce"
        },
        {
          "url": "https://git.kernel.org/stable/c/3260a3f0828e06f5f13fac69fb1999a6d60d9cff"
        }
      ],
      "title": "mm/damon/sysfs: fix use-after-free in state_show()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-39877",
    "datePublished": "2025-09-23T06:00:48.317Z",
    "dateReserved": "2025-04-16T07:20:57.144Z",
    "dateUpdated": "2026-05-11T21:38:09.382Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-39877",
      "date": "2026-09-16",
      "epss": "0.0015",
      "percentile": "0.04565"
    },
    "microsoft_vex": {
      "current_release_date": "2025-09-24T01:01:55.000Z",
      "cve": "CVE-2025-39877",
      "id": "msrc_CVE-2025-39877",
      "initial_release_date": "2025-09-02T00:00:00.000Z",
      "product_status:known_not_affected": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "mm/damon/sysfs: fix use-after-free in state_show()",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2025-39877.json",
      "version": "1"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-39877\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-09-23T06:15:47.230\",\"lastModified\":\"2026-06-17T09:18:43.673\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nmm/damon/sysfs: fix use-after-free in state_show()\\n\\nstate_show() reads kdamond-\u003edamon_ctx without holding damon_sysfs_lock. \\nThis allows a use-after-free race:\\n\\nCPU 0                         CPU 1\\n-----                         -----\\nstate_show()                  damon_sysfs_turn_damon_on()\\nctx = kdamond-\u003edamon_ctx;     mutex_lock(\u0026damon_sysfs_lock);\\n                              damon_destroy_ctx(kdamond-\u003edamon_ctx);\\n                              kdamond-\u003edamon_ctx = NULL;\\n                              mutex_unlock(\u0026damon_sysfs_lock);\\ndamon_is_running(ctx);        /* ctx is freed */\\nmutex_lock(\u0026ctx-\u003ekdamond_lock); /* UAF */\\n\\n(The race can also occur with damon_sysfs_kdamonds_rm_dirs() and\\ndamon_sysfs_kdamond_release(), which free or replace the context under\\ndamon_sysfs_lock.)\\n\\nFix by taking damon_sysfs_lock before dereferencing the context, mirroring\\nthe locking used in pid_show().\\n\\nThe bug has existed since state_show() first accessed kdamond-\u003edamon_ctx.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"mm/damon/sysfs.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"a61ea561c87139992fe32afdee48a6f6b85d824a\",\"lessThan\":\"3858c44341ad49dc7544b19cc9f9ecffaa7cc50e\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"a61ea561c87139992fe32afdee48a6f6b85d824a\",\"lessThan\":\"60d7a3d2b985a395318faa1d88da6915fad11c19\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"a61ea561c87139992fe32afdee48a6f6b85d824a\",\"lessThan\":\"26d29b2ac87a2989071755f9828ebf839b560d4c\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"a61ea561c87139992fe32afdee48a6f6b85d824a\",\"lessThan\":\"4e87f461d61959647464a94d11ae15c011be58ce\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"a61ea561c87139992fe32afdee48a6f6b85d824a\",\"lessThan\":\"3260a3f0828e06f5f13fac69fb1999a6d60d9cff\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"mm/damon/sysfs.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"5.18\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"5.18\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.1.153\",\"lessThanOrEqual\":\"6.1.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.6.107\",\"lessThanOrEqual\":\"6.6.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.12.48\",\"lessThanOrEqual\":\"6.12.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.16.8\",\"lessThanOrEqual\":\"6.16.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.17\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-416\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.18\",\"versionEndExcluding\":\"6.1.153\",\"matchCriteriaId\":\"7476DB08-58FC-455C-BA35-27E13002B258\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.2\",\"versionEndExcluding\":\"6.6.107\",\"matchCriteriaId\":\"D273EDA6-2CFE-4EBD-B024-62EB057830F3\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.7\",\"versionEndExcluding\":\"6.12.48\",\"matchCriteriaId\":\"9652E701-5C8E-49CF-89A5-499E214A5902\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.13\",\"versionEndExcluding\":\"6.16.8\",\"matchCriteriaId\":\"8DA00A4E-AABB-4A69-AB39-67B22D0B36D2\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"327D22EF-390B-454C-BD31-2ED23C998A1C\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"C730CD9A-D969-4A8E-9522-162AAF7C0EE9\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"39982C4B-716E-4B2F-8196-FA301F47807D\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:*\",\"matchCriteriaId\":\"340BEEA9-D70D-4290-B502-FBB1032353B1\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.17:rc5:*:*:*:*:*:*\",\"matchCriteriaId\":\"47E4C5C0-079F-4838-971B-8C503D48FCC2\"}]}]},{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*\",\"matchCriteriaId\":\"FA6FEEC2-9F11-4643-8827-749718254FED\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/26d29b2ac87a2989071755f9828ebf839b560d4c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/3260a3f0828e06f5f13fac69fb1999a6d60d9cff\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/3858c44341ad49dc7544b19cc9f9ecffaa7cc50e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/4e87f461d61959647464a94d11ae15c011be58ce\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/60d7a3d2b985a395318faa1d88da6915fad11c19\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Mailing List\",\"Third Party Advisory\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-06-30T01:24:06+00:00",
      "cve": "CVE-2025-39877",
      "id": "CVE-2025-39877",
      "initial_release_date": "2025-09-23T00:00:00+00:00",
      "product_status:known_affected": "184",
      "product_status:known_not_affected": "90",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: mm/damon/sysfs: fix use-after-free in state_show()",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-39877.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-08-28T16:57:25Z",
      "cve": "CVE-2025-39877",
      "id": "CVE-2025-39877",
      "initial_release_date": "2025-09-23T23:23:37Z",
      "product_status:first_fixed": "2",
      "product_status:known_not_affected": "523",
      "product_status:recommended": "154",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-39877",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-39877.json",
      "version": "25"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…