{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99986","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-09-25T10:25:14.450Z","datePublished":"2026-11-30T13:18:54.018Z","dateUpdated":"2026-12-01T05:44:32.858Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-01T05:44:32.858Z"},"descriptions":[{"lang":"en","value":"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->qpd.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->doorbell_mutex is not suitable here: it is acquired under\ndqm->lock on the kernel-doorbell path (start_cpsch() -> pm_init() ->\nkq_initialize() -> kfd_get_kernel_doorbell()), so holding it across\nthe sleeping allocations above would create a lock-ordering\ninversion with dqm->lock 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)"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The racing callers are local syscalls on /dev/kfd: mmap() into kfd_doorbell_mmap()->kfd_get_process_doorbells(), and ioctl AMDKFD_IOC_CREATE_QUEUE or ALLOC_MEMORY_OF_GPU with KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL. Each checks qpd->proc_doorbells and calls kfd_alloc_process_doorbells() without a common lock. No network or adjacent input is involved.\nAC:L - The attacker controls both sides with two threads of its own process: the mmap path holds only mmap_lock and the ioctl path only p->mutex. The attacker also causes the amdgpu_bo_create() failure that puts both threads in the err: path, by filling the doorbell aperture with its own KFD processes or with BOs leaked by this race. Failed attempts are cheap retries in the same process.\nPR:L - /dev/kfd is accessible to the render group and the seat user (uaccess). kfd_ioctl gives CREATE_QUEUE and ALLOC_MEMORY_OF_GPU flag 0, and kfd_mmap only checks that the caller is the owning process. An ordinary GPU-compute user can reach the race without any capability; the cap-gated CRIU restore path is not needed.\nUI:N - The attacker opens /dev/kfd and runs both racing threads itself. No other user or administrator has to do anything.\nS:U - The corrupted objects are kernel-side: qpd->doorbell_bitmap (kmalloc-128) and the doorbell amdgpu_bo/TTM state, and they belong to the same kernel authority. No VM, IOMMU or sandbox boundary is crossed.\nC:H - kfd_alloc_process_doorbells' err: path does bitmap_free(qpd->doorbell_bitmap) and then stores NULL, with no lock. When both threads fail, both can free the same 128-byte bitmap. When one fails mid init_doorbell_bitmap() of the other, the other writes into freed memory. A kmalloc-128 double free or UAF can be groomed into a kernel read primitive.\nI:H - The same unlocked err:-path double free of qpd->doorbell_bitmap corrupts the slab freelist so that two owners get one object, and init_doorbell_bitmap() can set bits in a freed object. Separately, the reread of *bo_ptr in amdgpu_bo_create_reserved/create_kernel unreserves another BO's dma_resv lock. Together these give kernel heap corruption usable for control-flow hijack.\nA:H - Each duplicate amdgpu_bo_create() leaks a pinned doorbell BO whose BAR slice is never freed, so repeating the race starves every user's KFD queues until reboot. Narrower windows dereference NULL: amdgpu_bo_create zeroes *bo_ptr while the other thread uses it, or the bitmap is NULLed. Pin-count imbalance trips the pin_count WARN_ON_ONCE in ttm_bo_release."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/amd/amdkfd/kfd_chardev.c","drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c","drivers/gpu/drm/amd/amdkfd/kfd_priv.h","drivers/gpu/drm/amd/amdkfd/kfd_process.c"],"versions":[{"version":"16f0013157bf8c95d10b9360491e3c920f85641e","lessThan":"99dfb16dd7cbe0e0c298b65e099e8d5b93ad8ac5","status":"affected","versionType":"git"},{"version":"16f0013157bf8c95d10b9360491e3c920f85641e","lessThan":"f56f23b99d67b523c7b92ee0385851de079bbafe","status":"affected","versionType":"git"},{"version":"16f0013157bf8c95d10b9360491e3c920f85641e","lessThan":"8b1cb368bce3a3a670e36b82372aa0033ffe3d85","status":"affected","versionType":"git"},{"version":"16f0013157bf8c95d10b9360491e3c920f85641e","lessThan":"2081dc291247066cf174f9ad4b20eaffc5663dc0","status":"affected","versionType":"git"},{"version":"16f0013157bf8c95d10b9360491e3c920f85641e","lessThan":"84d62591d343e1aa2c045cf4c5f079eee4500da7","status":"affected","versionType":"git"},{"version":"16f0013157bf8c95d10b9360491e3c920f85641e","lessThan":"bebad45050945a3d668d6701fb77ae2571c5d44b","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/amd/amdkfd/kfd_chardev.c","drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c","drivers/gpu/drm/amd/amdkfd/kfd_priv.h","drivers/gpu/drm/amd/amdkfd/kfd_process.c"],"versions":[{"version":"6.1","status":"affected"},{"version":"0","lessThan":"6.1","status":"unaffected","versionType":"semver"},{"version":"6.1.193","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.163","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.117","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.63","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.4","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.18.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/99dfb16dd7cbe0e0c298b65e099e8d5b93ad8ac5"},{"url":"https://git.kernel.org/stable/c/f56f23b99d67b523c7b92ee0385851de079bbafe"},{"url":"https://git.kernel.org/stable/c/8b1cb368bce3a3a670e36b82372aa0033ffe3d85"},{"url":"https://git.kernel.org/stable/c/2081dc291247066cf174f9ad4b20eaffc5663dc0"},{"url":"https://git.kernel.org/stable/c/84d62591d343e1aa2c045cf4c5f079eee4500da7"},{"url":"https://git.kernel.org/stable/c/bebad45050945a3d668d6701fb77ae2571c5d44b"}],"title":"drm/amdkfd: fix doorbell allocation race creating duplicate allocations","x_generator":{"engine":"bippy-1.2.0"}}}}