{"id":"CVE-2026-99986","summary":"drm/amdkfd: fix doorbell allocation race creating duplicate allocations","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdkfd: fix doorbell allocation race creating duplicate allocations\n\nThe check-and-allocate sequence on pdd-\u003eqpd.proc_doorbells is\nlockless at every call site of kfd_alloc_process_doorbells():\nkfd_get_process_doorbells() (mmap of /dev/kfd),\nkfd_ioctl_create_queue() and the CRIU restore path each test the\npointer under different locking (or none), so two racing threads can\nboth observe NULL and each allocate a doorbell BO and bitmap,\norphaning one allocation and handing the two mappings different\nbacking pages.\n\nMove the serialization into kfd_alloc_process_doorbells() itself,\nusing a new per-process-device mutex so all three call sites are\ncovered regardless of their own locking.  The device-global\nkfd-\u003edoorbell_mutex is not suitable here: it is acquired under\ndqm-\u003elock on the kernel-doorbell path (start_cpsch() -\u003e pm_init() -\u003e\nkq_initialize() -\u003e kfd_get_kernel_doorbell()), so holding it across\nthe sleeping allocations above would create a lock-ordering\ninversion with dqm-\u003elock via TTM eviction, and it would also\nserialize doorbell setup of unrelated processes behind a\ndevice-wide lock for per-process state.\n\nThis issue was discovered by Tencent CodeBuddy Security.\n\nv3 (Felix Kuehling):\n- Removed unlocked check in kfd_get_process_doorbell flagged as\n  problematic by Sashiko Bot. Fall back to the locked check inside\n  kfd_alloc_process_doorbells\n- Added missing mutex_destroy\nv4 (Felix Kuehling):\n- Removed unlocked checks around other kfd_alloc_process_doorbells calls\n\n(cherry picked from commit 4e27ba5ad5f76932d4f6cbacd25c81c2dd40ec4a)","modified":"2026-11-30T15:02:33.076964928Z","published":"2026-11-30T13:18:54.018Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99986.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2081dc291247066cf174f9ad4b20eaffc5663dc0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/84d62591d343e1aa2c045cf4c5f079eee4500da7"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8b1cb368bce3a3a670e36b82372aa0033ffe3d85"},{"type":"WEB","url":"https://git.kernel.org/stable/c/99dfb16dd7cbe0e0c298b65e099e8d5b93ad8ac5"},{"type":"WEB","url":"https://git.kernel.org/stable/c/bebad45050945a3d668d6701fb77ae2571c5d44b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f56f23b99d67b523c7b92ee0385851de079bbafe"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99986.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99986"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"16f0013157bf8c95d10b9360491e3c920f85641e"},{"fixed":"99dfb16dd7cbe0e0c298b65e099e8d5b93ad8ac5"},{"fixed":"f56f23b99d67b523c7b92ee0385851de079bbafe"},{"fixed":"8b1cb368bce3a3a670e36b82372aa0033ffe3d85"},{"fixed":"2081dc291247066cf174f9ad4b20eaffc5663dc0"},{"fixed":"84d62591d343e1aa2c045cf4c5f079eee4500da7"},{"fixed":"bebad45050945a3d668d6701fb77ae2571c5d44b"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99986.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.1.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99986.json"}}],"schema_version":"1.9.2"}