{
  "id": "CVE-2025-39877",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-39877",
  "published_at": "2025-09-23T06:00:48.317Z",
  "title": "mm/damon/sysfs: fix use-after-free in state_show()",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "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.",
  "cwe": "CWE-416",
  "cpes": [
    "cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.17:rc5:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "nvd": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= a61ea561c87139992fe32afdee48a6f6b85d824a, \u003c 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e",
          "\u003e= a61ea561c87139992fe32afdee48a6f6b85d824a, \u003c 60d7a3d2b985a395318faa1d88da6915fad11c19",
          "\u003e= a61ea561c87139992fe32afdee48a6f6b85d824a, \u003c 26d29b2ac87a2989071755f9828ebf839b560d4c",
          "\u003e= a61ea561c87139992fe32afdee48a6f6b85d824a, \u003c 4e87f461d61959647464a94d11ae15c011be58ce",
          "\u003e= a61ea561c87139992fe32afdee48a6f6b85d824a, \u003c 3260a3f0828e06f5f13fac69fb1999a6d60d9cff"
        ],
        "fixed_in": [
          "3858c44341ad49dc7544b19cc9f9ecffaa7cc50e",
          "60d7a3d2b985a395318faa1d88da6915fad11c19",
          "26d29b2ac87a2989071755f9828ebf839b560d4c",
          "4e87f461d61959647464a94d11ae15c011be58ce",
          "3260a3f0828e06f5f13fac69fb1999a6d60d9cff"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "5.18"
        ],
        "fixed_in": [
          "0",
          "6.1.153",
          "6.6.107",
          "6.12.48",
          "6.16.8",
          "6.17"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 3858c44341ad49dc7544b19cc9f9ecffaa7cc50e or 60d7a3d2b985a395318faa1d88da6915fad11c19 or 26d29b2ac87a2989071755f9828ebf839b560d4c or 4e87f461d61959647464a94d11ae15c011be58ce or 3260a3f0828e06f5f13fac69fb1999a6d60d9cff or later.",
      "Upgrade Linux to 0 or 6.1.153 or 6.6.107 or 6.12.48 or 6.16.8 or 6.17 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
