{
  "id": "CVE-2025-22126",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-22126",
  "published_at": "2025-04-16T14:13:09.399Z",
  "title": "md: fix mddev uaf while iterating all_mddevs list",
  "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\nmd: fix mddev uaf while iterating all_mddevs list\n\nWhile iterating all_mddevs list from md_notify_reboot() and md_exit(),\nlist_for_each_entry_safe is used, and this can race with deletint the\nnext mddev, causing UAF:\n\nt1:\nspin_lock\n//list_for_each_entry_safe(mddev, n, ...)\n mddev_get(mddev1)\n // assume mddev2 is the next entry\n spin_unlock\n            t2:\n            //remove mddev2\n            ...\n            mddev_free\n            spin_lock\n            list_del\n            spin_unlock\n            kfree(mddev2)\n mddev_put(mddev1)\n spin_lock\n //continue dereference mddev2-\u003eall_mddevs\n\nThe old helper for_each_mddev() actually grab the reference of mddev2\nwhile holding the lock, to prevent from being freed. This problem can be\nfixed the same way, however, the code will be complex.\n\nHence switch to use list_for_each_entry, in this case mddev_put() can free\nthe mddev1 and it's not safe as well. Refer to md_seq_show(), also factor\nout a helper mddev_put_locked() to fix this problem.",
  "cwe": "CWE-416",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "nvd": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= f26514342255855f4ca3c0a92cb1cdea01c33004, \u003c ca9f84de76723b358dfc0606668efdca54afc2e5",
          "\u003e= f26514342255855f4ca3c0a92cb1cdea01c33004, \u003c d69a23d8e925f8052d657652a6875ec2712c7e33",
          "\u003e= f26514342255855f4ca3c0a92cb1cdea01c33004, \u003c e2a9f73ee408a460f4c9dfe03b4741d6b11652b8",
          "\u003e= f26514342255855f4ca3c0a92cb1cdea01c33004, \u003c 5462544ccbad3fc938a71b01fa5bd3a0dc2b750a",
          "\u003e= f26514342255855f4ca3c0a92cb1cdea01c33004, \u003c 8542870237c3a48ff049b6c5df5f50c8728284fa"
        ],
        "fixed_in": [
          "ca9f84de76723b358dfc0606668efdca54afc2e5",
          "d69a23d8e925f8052d657652a6875ec2712c7e33",
          "e2a9f73ee408a460f4c9dfe03b4741d6b11652b8",
          "5462544ccbad3fc938a71b01fa5bd3a0dc2b750a",
          "8542870237c3a48ff049b6c5df5f50c8728284fa"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.0"
        ],
        "fixed_in": [
          "0",
          "6.1.135",
          "6.6.88",
          "6.12.25",
          "6.14.2",
          "6.15"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to ca9f84de76723b358dfc0606668efdca54afc2e5 or d69a23d8e925f8052d657652a6875ec2712c7e33 or e2a9f73ee408a460f4c9dfe03b4741d6b11652b8 or 5462544ccbad3fc938a71b01fa5bd3a0dc2b750a or 8542870237c3a48ff049b6c5df5f50c8728284fa or later.",
      "Upgrade Linux to 0 or 6.1.135 or 6.6.88 or 6.12.25 or 6.14.2 or 6.15 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
