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=1796045690; b=L/8zFScm/rrwUvC2hq+GlhIk2GzzX8hiyvOjyCWf/YqR41ovB+60ggEe3P7AfmeTxwTd /pz9pxynlDYjetdXWwJSWENhvw2ghT35me4bbfEAZNbZlMt0uqXmqWVm5BL8quS8hF6Oa 4E/z1pB385QgEHvgd1ULTWMHyuADKRh6i5ZvTy69cCqZr/njFUnBChWw38+4XsjRGfrW7 rP8jVqBqFDepDdo3pElY2UDOC6a1XRQttG7h3KON9GDGsJZpucGWNEmMSlz7PeRZcwGoK wBkCFF0wLAUa3zyB3+qN8gpXuIGscGi+Fcc/SEBBnTo//DVfVQAEQcoA7dml3yoEWug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796045690; 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=WAUMk0YKbw3tJmqsf3a3bgfbN8qoe065Pd/di8ytcoc=; b=zxZ+mZWJWMEcPgl33ZvJlooSP74IHAKbCIysrivgmYsSPljm7XQvuRSzZnPVddURLEpV Qj7nyaEIguvLcaHh/KF3s1Op/esmvKsIPhhl4paNFkJqzIR4Hr6rVulkXJ192iMgNA63t TY3CnKmZGmncZxIzviVZW1swqhR0dssIcWLXX/Cv4I9THhEIB1+DWIxgpn71xPbbW93hs ljT2Q4WAxy297aHuXVqFZF5QuLd3qoJN1ZRaO8w0SFp682DcwPAG/7hMI9kwClCenGXWB hpBT9p45XRT2ZZvkfMSAIrpoNVddRc9ktfsrPxmKiMSmX3imIJ0CR3aH9xiw3Ehy51w== 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=GcR9J+k0; 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 92F82606A320 for ; Mon, 30 Nov 2026 13:34:50 +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=GcR9J+k0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA6021F00896; Mon, 30 Nov 2026 13:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796045690; bh=WAUMk0YKbw3tJmqsf3a3bgfbN8qoe065Pd/di8ytcoc=; h=From:To:Cc:Subject:Date:Reply-To; b=GcR9J+k0ZN9BVXXD9FjBAZgKCGzXcfo5mmBubCrhq1yRNujsl/IwR7u/SOA1Sx9si TSUk5l6YN400mhmWs6iq1FL8Wrt3uhAfloPMvBjJgx5pvqxKDfj4AjGxSyEUD9FDLR yplwaUkgEkfwQ5bbntzTR1mL2xmCpnQjSMtfBkIU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99981: drm/amdgpu: wait for pending page table updates before switching a VM to CPU updates Date: Mon, 30 Nov 2026 14:20:11 +0100 Message-ID: <2026113003-CVE-2026-99981-ad60@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=5087; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=nsH3bhqZmh8eLRXiySYu7W/x4CJs19CB5n2vHrqlO50=; b=owGbwMvMwCRo6H6F97bub03G02pJDNm85d3Jb96FXRDUkHpv172gzjTtrldDah9jbI5IRr270 RRRydqOWBYGQSYGWTFFli/beI7urzik6GVoexpmDisTyBAGLk4BmMgid4b5bsr9m6N2TZ9+xrNK NUz6uFjj2t4Ghnlm89KchaW+2TOJH2zZN+f93iMt7kUA 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/amdgpu: wait for pending page table updates before switching a VM to CPU updates amdgpu_vm_make_compute() switches a VM from SDMA to CPU page table updates when a KFD process acquires it. It syncs "with the last SDMA update/clear" through amdgpu_bo_sync_wait() on the root PD, but that walks the reservation with DMA_RESV_USAGE_READ, and the clears of the VM's page tables (the root PD from amdgpu_vm_init(), and the PDs/PTs the seq64 mapping allocates at the render node's open) are added there by amdgpu_vm_sdma_commit() with DMA_RESV_USAGE_BOOKKEEP only: amdgpu_vm_pt_clear() commits them with a NULL fence, so they do not reach vm->last_update. The CPU path's own waits (amdgpu_vm_cpu_update(), amdgpu_bo_kmap()) use DMA_RESV_USAGE_KERNEL. None of them waits for a clear that is still queued. When one is, the CPU writes the first entries of the new compute VM (the KFD trap handler's TBA/TMA page at AMDGPU_VA_RESERVED_TRAP_START, mapped during ACQUIRE_VM) into a page directory the SDMA then clears. The entries are gone, the handler's page is unmapped, and the first wave save of any queue of the process faults in the SQC instruction fetch at the handler's address (GCVM_L2_PROTECTION_FAULT_STATUS 0x008012B1, PERMISSION_FAULTS 0xb). The MES then fails REMOVE_QUEUE and SUSPEND, and the device takes a MODE1 reset with VRAM lost on 7.2.9; on 7.3-rc6 the queue is reset instead. The window is the time between the render node's open and ACQUIRE_VM. ROCr spends milliseconds there and is practically never hit; a minimal KFD client that opens the render node and acquires the VM at once is hit most of the time. On a Radeon AI PRO R9700 (gfx1201, Resizable BAR, so vm_update_mode defaults to CPU updates for compute VMs), a wave reading the trap handler's page right after queue creation found it unmapped in 8 of 12 runs; a 5 ms sleep between the open and ACQUIRE_VM made that 0 of 9, and the same sleep after queue creation instead 3 of 3. The wait covered these jobs until commit 926c79ad6ecd ("drm/amdgpu: promote the implicit sync to the dependent read fences") narrowed amdgpu_sync_resv() from DMA_RESV_USAGE_BOOKKEEP to DMA_RESV_USAGE_READ; the VM's page table jobs have been added with BOOKKEEP since commit 4247084057cf ("drm/amdgpu: use DMA_RESV_USAGE_BOOKKEEP v2"), so from v6.16 on the sync in amdgpu_vm_make_compute() waits for nothing of them. Record the clears in vm->last_update, as amdgpu_vm_update_pdes() does with its updates, and wait for it, uninterruptibly, before switching the update functions. The clears all go through vm->delayed, so the last one covers the earlier ones; immediate clears are not recorded, as before. With this, on 7.3-rc6 and on 7.2.9, the same client reads the handler 10 of 10 times, 8 busy queues on the 4 compute slots complete in 5 of 5 runs on 7.3-rc6 and 3 of 3 on 7.2.9 (1 of 6 before), 16 and 32 queues complete on 7.3-rc6, and two processes with 8 queues each complete together on both, with no fault. (cherry picked from commit 9ec91b35baba45209c3fcd00f086224a158dd512) The Linux kernel CVE team has assigned CVE-2026-99981 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit 926c79ad6ecde21e7e2d7415f873d57c364611f1 and fixed in 6.18.63 with commit 2368f9aed09cbabb5a8980c2fbc78bde98e170e9 Issue introduced in 6.16 with commit 926c79ad6ecde21e7e2d7415f873d57c364611f1 and fixed in 7.3.4 with commit eb8cfa911806bd379949271335ef8246f89d330f Issue introduced in 6.16 with commit 926c79ad6ecde21e7e2d7415f873d57c364611f1 and fixed in 7.4-rc1 with commit 53d9ef2f518add783bb48a69d77bbc8aea99e911 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-99981 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/amdgpu/amdgpu_vm.c drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.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/2368f9aed09cbabb5a8980c2fbc78bde98e170e9 https://git.kernel.org/stable/c/eb8cfa911806bd379949271335ef8246f89d330f https://git.kernel.org/stable/c/53d9ef2f518add783bb48a69d77bbc8aea99e911