{
  "id": "CVE-2025-40249",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-40249",
  "published_at": "2025-12-04T16:08:12.206Z",
  "title": "gpio: cdev: make sure the cdev fd is still active before emitting events",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "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\ngpio: cdev: make sure the cdev fd is still active before emitting events\n\nWith the final call to fput() on a file descriptor, the release action\nmay be deferred and scheduled on a work queue. The reference count of\nthat descriptor is still zero and it must not be used. It's possible\nthat a GPIO change, we want to notify the user-space about, happens\nAFTER the reference count on the file descriptor associated with the\ncharacter device went down to zero but BEFORE the .release() callback\nwas called from the workqueue and so BEFORE we unregistered from the\nnotifier.\n\nUsing the regular get_file() routine in this situation triggers the\nfollowing warning:\n\n  struct file::f_count incremented from zero; use-after-free condition present!\n\nSo use the get_file_active() variant that will return NULL on file\ndescriptors that have been or are being released.",
  "cvss_by_source": {
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= 40b7c49950bd56c984b1f6722f865b922879260e, \u003c dccc6daa8afa0f64c432e4c867f275747e3415e1",
          "\u003e= 40b7c49950bd56c984b1f6722f865b922879260e, \u003c d4cd0902c156b2ca60fdda8cd8b5bcb4b0e9ed64"
        ],
        "fixed_in": [
          "dccc6daa8afa0f64c432e4c867f275747e3415e1",
          "d4cd0902c156b2ca60fdda8cd8b5bcb4b0e9ed64"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.13"
        ],
        "fixed_in": [
          "0",
          "6.17.10",
          "6.18"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to dccc6daa8afa0f64c432e4c867f275747e3415e1 or d4cd0902c156b2ca60fdda8cd8b5bcb4b0e9ed64 or later.",
      "Upgrade Linux to 0 or 6.17.10 or 6.18 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
