{
  "id": "CVE-2026-45878",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-45878",
  "published_at": "2026-05-27T12:16:49.108Z",
  "title": "drm/amdkfd: Fix watch_id bounds checking in debug address watch v2",
  "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\ndrm/amdkfd: Fix watch_id bounds checking in debug address watch v2\n\nThe address watch clear code receives watch_id as an unsigned value\n(u32), but some helper functions were using a signed int and checked\nbits by shifting with watch_id.\n\nIf a very large watch_id is passed from userspace, it can be converted\nto a negative value.  This can cause invalid shifts and may access\nmemory outside the watch_points array.\n\ndrm/amdkfd: Fix watch_id bounds checking in debug address watch v2\n\nFix this by checking that watch_id is within MAX_WATCH_ADDRESSES before\nusing it.  Also use BIT(watch_id) to test and clear bits safely.\n\nThis keeps the behavior unchanged for valid watch IDs and avoids\nundefined behavior for invalid ones.\n\nFixes the below:\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_debug.c:448\nkfd_dbg_trap_clear_dev_address_watch() error: buffer overflow\n'pdd-\u003ewatch_points' 4 \u003c= u32max user_rl='0-3,2147483648-u32max' uncapped\n\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_debug.c\n    433 int kfd_dbg_trap_clear_dev_address_watch(struct kfd_process_device *pdd,\n    434                                         uint32_t watch_id)\n    435 {\n    436         int r;\n    437\n    438         if (!kfd_dbg_owns_dev_watch_id(pdd, watch_id))\n\nkfd_dbg_owns_dev_watch_id() doesn't check for negative values so if\nwatch_id is larger than INT_MAX it leads to a buffer overflow.\n(Negative shifts are undefined).\n\n    439                 return -EINVAL;\n    440\n    441         if (!pdd-\u003edev-\u003ekfd-\u003eshared_resources.enable_mes) {\n    442                 r = debug_lock_and_unmap(pdd-\u003edev-\u003edqm);\n    443                 if (r)\n    444                         return r;\n    445         }\n    446\n    447         amdgpu_gfx_off_ctrl(pdd-\u003edev-\u003eadev, false);\n--\u003e 448         pdd-\u003ewatch_points[watch_id] = pdd-\u003edev-\u003ekfd2kgd-\u003eclear_address_watch(\n    449                                                         pdd-\u003edev-\u003eadev,\n    450                                                         watch_id);\n\nv2: (as per, Jonathan Kim)\n - Add early watch_id \u003e= MAX_WATCH_ADDRESSES validation in the set path to\n   match the clear path.\n - Drop the redundant bounds check in kfd_dbg_owns_dev_watch_id().",
  "cwe": "CWE-125",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= e0f85f4690d089cc1a60337decafb1acf7eec45e, \u003c 971bf8e61e9b4abaacf9b35eaf76ec222758f9d6",
          "\u003e= e0f85f4690d089cc1a60337decafb1acf7eec45e, \u003c a0d367e13db63a6ed76ee0d0a8c3a58c1fa98488",
          "\u003e= e0f85f4690d089cc1a60337decafb1acf7eec45e, \u003c 2b36c0c1bcbbe15f6cfa9652084b3124c835a150",
          "\u003e= e0f85f4690d089cc1a60337decafb1acf7eec45e, \u003c 3c38a0f07aa2bfef2b219b1f045534ad93f85afd",
          "\u003e= e0f85f4690d089cc1a60337decafb1acf7eec45e, \u003c 5a19302cab5cec7ae7f1a60c619951e6c17d8742"
        ],
        "fixed_in": [
          "971bf8e61e9b4abaacf9b35eaf76ec222758f9d6",
          "a0d367e13db63a6ed76ee0d0a8c3a58c1fa98488",
          "2b36c0c1bcbbe15f6cfa9652084b3124c835a150",
          "3c38a0f07aa2bfef2b219b1f045534ad93f85afd",
          "5a19302cab5cec7ae7f1a60c619951e6c17d8742"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.5"
        ],
        "fixed_in": [
          "0",
          "6.6.128",
          "6.12.75",
          "6.18.14",
          "6.19.4",
          "7.0"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 971bf8e61e9b4abaacf9b35eaf76ec222758f9d6 or a0d367e13db63a6ed76ee0d0a8c3a58c1fa98488 or 2b36c0c1bcbbe15f6cfa9652084b3124c835a150 or 3c38a0f07aa2bfef2b219b1f045534ad93f85afd or 5a19302cab5cec7ae7f1a60c619951e6c17d8742 or later.",
      "Upgrade Linux to 0 or 6.6.128 or 6.12.75 or 6.18.14 or 6.19.4 or 7.0 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
