From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796045704; b=WM9r2El1JQz8GjFYnUqB7Ej9Hz7pDqdGej/7GRkDr5HVx3MzUTbpNB0ENZ+SzityyoXH /2xulSqIodtfHMtGo1M/yP3/GnGqtUy3OPJS+huRWKvrhJfHNZC/AZPi2/2LE4+NhFnD7 bLRXu4lx1151wVcFX/HvEPh/eJVOTg1VdwBSCdt8wE1sj9KcmtnGwOaka3QNC3eYuq0kc vzEnYGOp+PPZIQuhqHssHH+V11VMBnvkag6G50qQlnMt2Exu1qDyLFkdZqxwukAwrB9oF 0KS3V8k9AgueoOiAa3MqPtTQB9/lDAAttghTYoIUngdLEnVs3Vdh2x17coQFrc3jpBQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796045704; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=pJVl91qbcghXtaks4qAZbzCb4DJYKUVtEvskNx87RRo=; b=sxupEyxRiGRUK5nJlfeGJm7yADOqoPTvtrTYjEB5achvtT/cPxgNvsC3DOnT5+FdMXou /b2xypNyUrccCFkLWcb6PmbULhlCfnQYIRNqd6ArCn5O+SE7YENVcLqymzKW2xqxuKpgq kIiLcmpgD1I5DzQ9sXskegxxstl2idU5tmDqURmaCwSf+TFPfgjbx0nEtGDQ/emcmtnhH 6QLQ8l2H1XUSNxa+yoQ4Ov1iqo/FTdsMs0R6H8CAB5W8JjfdKtTGkN2ZqBFbS8qYpgOpP Rq34vQXoGPK7BbPCERDzNr6vTxb7RPiLwnVDLDR2hNyWbcoDl7ml7d9DfE2gf7SMCeg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FtyUYGZg; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6DD0606A325 for ; Mon, 30 Nov 2026 13:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FtyUYGZg Received: by smtp.kernel.org (Postfix) with ESMTPSA id F060F1F000C1; Mon, 30 Nov 2026 13:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796045704; bh=pJVl91qbcghXtaks4qAZbzCb4DJYKUVtEvskNx87RRo=; h=From:To:Cc:Subject:Date:Reply-To; b=FtyUYGZghzQS5QPRdvD/I0JYh/DtuVtnJji7NHRRmZtaqJDUz9Vp8meaVk4dtDChQ vXfMjUGG+CKLUXTTX8FA0c+PTmNvCiTkqeDJEoZx7q6xX4QxH1Hyv5P8GqWCvZUyww 9VAp+dqjAe7x5KTQxfH7cmy8EO5P+xBxSJ81qGmM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99986: drm/amdkfd: fix doorbell allocation race creating duplicate allocations Date: Mon, 30 Nov 2026 14:20:16 +0100 Message-ID: <2026113003-CVE-2026-99986-7cbf@gregkh> X-Mailer: git-send-email 2.56.1 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4356; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=6++XLPQjtcC7bqk+uGFUs6Gr6yeGUir+vTY1BUEWmks=; b=owGbwMvMwCRo6H6F97bub03G02pJDNm85T3XFHferXNaF8gxXUdNjZktziPwpIGPuPuiU5PFu 8ykLk3tiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgInsk2ZYMFOdSSBGgvW/9M50 7p5KMX7pt9FXGBZMO6fyxKfx+e+dE1/+nGphECEz42UkAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: fix doorbell allocation race creating duplicate allocations The check-and-allocate sequence on pdd->qpd.proc_doorbells is lockless at every call site of kfd_alloc_process_doorbells(): kfd_get_process_doorbells() (mmap of /dev/kfd), kfd_ioctl_create_queue() and the CRIU restore path each test the pointer under different locking (or none), so two racing threads can both observe NULL and each allocate a doorbell BO and bitmap, orphaning one allocation and handing the two mappings different backing pages. Move the serialization into kfd_alloc_process_doorbells() itself, using a new per-process-device mutex so all three call sites are covered regardless of their own locking. The device-global kfd->doorbell_mutex is not suitable here: it is acquired under dqm->lock on the kernel-doorbell path (start_cpsch() -> pm_init() -> kq_initialize() -> kfd_get_kernel_doorbell()), so holding it across the sleeping allocations above would create a lock-ordering inversion with dqm->lock via TTM eviction, and it would also serialize doorbell setup of unrelated processes behind a device-wide lock for per-process state. This issue was discovered by Tencent CodeBuddy Security. v3 (Felix Kuehling): - Removed unlocked check in kfd_get_process_doorbell flagged as problematic by Sashiko Bot. Fall back to the locked check inside kfd_alloc_process_doorbells - Added missing mutex_destroy v4 (Felix Kuehling): - Removed unlocked checks around other kfd_alloc_process_doorbells calls (cherry picked from commit 4e27ba5ad5f76932d4f6cbacd25c81c2dd40ec4a) The Linux kernel CVE team has assigned CVE-2026-99986 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit 16f0013157bf8c95d10b9360491e3c920f85641e and fixed in 6.1.193 with commit 99dfb16dd7cbe0e0c298b65e099e8d5b93ad8ac5 Issue introduced in 6.1 with commit 16f0013157bf8c95d10b9360491e3c920f85641e and fixed in 6.6.163 with commit f56f23b99d67b523c7b92ee0385851de079bbafe Issue introduced in 6.1 with commit 16f0013157bf8c95d10b9360491e3c920f85641e and fixed in 6.12.117 with commit 8b1cb368bce3a3a670e36b82372aa0033ffe3d85 Issue introduced in 6.1 with commit 16f0013157bf8c95d10b9360491e3c920f85641e and fixed in 6.18.63 with commit 2081dc291247066cf174f9ad4b20eaffc5663dc0 Issue introduced in 6.1 with commit 16f0013157bf8c95d10b9360491e3c920f85641e and fixed in 7.3.4 with commit 84d62591d343e1aa2c045cf4c5f079eee4500da7 Issue introduced in 6.1 with commit 16f0013157bf8c95d10b9360491e3c920f85641e and fixed in 7.4-rc1 with commit bebad45050945a3d668d6701fb77ae2571c5d44b Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-99986 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: 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 Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/99dfb16dd7cbe0e0c298b65e099e8d5b93ad8ac5 https://git.kernel.org/stable/c/f56f23b99d67b523c7b92ee0385851de079bbafe https://git.kernel.org/stable/c/8b1cb368bce3a3a670e36b82372aa0033ffe3d85 https://git.kernel.org/stable/c/2081dc291247066cf174f9ad4b20eaffc5663dc0 https://git.kernel.org/stable/c/84d62591d343e1aa2c045cf4c5f079eee4500da7 https://git.kernel.org/stable/c/bebad45050945a3d668d6701fb77ae2571c5d44b