Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37E1C288AD for ; Mon, 8 Dec 2025 00:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765154881; cv=none; b=JhCZxcN9ZQgxEKwbozRY2qiHz+dgMfat4Qzbwj1pDF3iAUbGdTdJQwJG6RjaVvDiL0PIo4dZOOWl/Hq4F+cHJd5XIE0kKE2bAL6kEo0c1oe5WFPcXoWrY9zwnWTKSussxRLv2KQ2FyfQ6fOrs/gaMatGkqOVBN/2jnK3nGPzAEk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765154881; c=relaxed/simple; bh=sDnPY++9dIgGMN5g85dGNmZBAJ7ZyJclMlE9N/WpzNo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=reY8frxcjGEWy2ZNNuXtyqWqHtQvHVHcUxuq82yfLNjmsc4gtNAhhZF5Q2YDp7HpsXXYpCWnYQkeG24hT6gPqImDsBSiOjUZcav9utAkqfMAX2gKeJBmbnsZivs+0ui5ZP7/49bOA35OH7SdVzJ/NlPpajDeWRY2RChEiUOqWyo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wZplMY0n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wZplMY0n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD8B1C4CEFB; Mon, 8 Dec 2025 00:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765154881; bh=sDnPY++9dIgGMN5g85dGNmZBAJ7ZyJclMlE9N/WpzNo=; h=From:To:Cc:Subject:Date:Reply-To:From; b=wZplMY0nZGV1kMwpzlrKwErQ0nNvBQTV+YhlI9qZ7qJltqVHneWOGMxeDMCWh07bO EWbt7EQm7eBWyve3qJpqHFhm+q2CpfzlLVDfGJ9mP/gb4z6yNUy0JbxB1TyRmFlcat G9mf7BtOQZXefURqJR6lhPLkNS66QHrx7ZJr2aCs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40310: amd/amdkfd: resolve a race in amdgpu_amdkfd_device_fini_sw Date: Mon, 8 Dec 2025 09:47:34 +0900 Message-ID: <2025120821-CVE-2025-40310-23c0@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4072; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=nF/Jk2FRHpIGvDhW1M8txU8Z4H8B3N4dKts6yYlbZYQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlmCpJ51790he0tjFH4YrpoV7Aox5l/IW/KpU0r03NXi 5/QCintiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIkIiDMsmLTl6pJ2Db2ZmZrq q5kZ17uy6rybyTBX9vzhH+HSW0/bZ005rp+q7xpn9TYVAA== 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: amd/amdkfd: resolve a race in amdgpu_amdkfd_device_fini_sw There is race in amdgpu_amdkfd_device_fini_sw and interrupt. if amdgpu_amdkfd_device_fini_sw run in b/w kfd_cleanup_nodes and kfree(kfd), and KGD interrupt generated. kernel panic log: BUG: kernel NULL pointer dereference, address: 0000000000000098 amdgpu 0000:c8:00.0: amdgpu: Requesting 4 partitions through PSP PGD d78c68067 P4D d78c68067 kfd kfd: amdgpu: Allocated 3969056 bytes on gart PUD 1465b8067 PMD @ Oops: @002 [#1] SMP NOPTI kfd kfd: amdgpu: Total number of KFD nodes to be created: 4 CPU: 115 PID: @ Comm: swapper/115 Kdump: loaded Tainted: G S W OE K RIP: 0010:_raw_spin_lock_irqsave+0x12/0x40 Code: 89 e@ 41 5c c3 cc cc cc cc 66 66 2e Of 1f 84 00 00 00 00 00 OF 1f 40 00 Of 1f 44% 00 00 41 54 9c 41 5c fa 31 cO ba 01 00 00 00 OF b1 17 75 Ba 4c 89 e@ 41 Sc 89 c6 e8 07 38 5d RSP: 0018: ffffc90@1a6b0e28 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000018 0000000000000001 RSI: ffff8883bb623e00 RDI: 0000000000000098 ffff8883bb000000 RO8: ffff888100055020 ROO: ffff888100055020 0000000000000000 R11: 0000000000000000 R12: 0900000000000002 ffff888F2b97da0@ R14: @000000000000098 R15: ffff8883babdfo00 CS: 010 DS: 0000 ES: 0000 CRO: 0000000080050033 CR2: 0000000000000098 CR3: 0000000e7cae2006 CR4: 0000000002770ce0 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 0000000000000000 DR6: 00000000fffeO7FO DR7: 0000000000000400 PKRU: 55555554 Call Trace: kgd2kfd_interrupt+@x6b/0x1f@ [amdgpu] ? amdgpu_fence_process+0xa4/0x150 [amdgpu] kfd kfd: amdgpu: Node: 0, interrupt_bitmap: 3 YcpxFl Rant tErace amdgpu_irq_dispatch+0x165/0x210 [amdgpu] amdgpu_ih_process+0x80/0x100 [amdgpu] amdgpu: Virtual CRAT table created for GPU amdgpu_irq_handler+0x1f/@x60 [amdgpu] __handle_irq_event_percpu+0x3d/0x170 amdgpu: Topology: Add dGPU node [0x74a2:0x1002] handle_irq_event+0x5a/@xcO handle_edge_irq+0x93/0x240 kfd kfd: amdgpu: KFD node 1 partition @ size 49148M asm_call_irq_on_stack+0xf/@x20 common_interrupt+0xb3/0x130 asm_common_interrupt+0x1le/0x40 5.10.134-010.a1i5000.a18.x86_64 #1 The Linux kernel CVE team has assigned CVE-2025-40310 to this issue. Affected and fixed versions =========================== Fixed in 6.6.117 with commit 93f8d67ef8b50334a26129df4da5a4cb60ad4090 Fixed in 6.12.58 with commit bc9e789053abe463f8cf74eee5fc2f157c11a79f Fixed in 6.17.8 with commit 2f89a2d15550b653caaeeab7ab68c4d7583fd4fe Fixed in 6.18 with commit 99d7181bca34e96fbf61bdb6844918bdd4df2814 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-2025-40310 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_device.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/93f8d67ef8b50334a26129df4da5a4cb60ad4090 https://git.kernel.org/stable/c/bc9e789053abe463f8cf74eee5fc2f157c11a79f https://git.kernel.org/stable/c/2f89a2d15550b653caaeeab7ab68c4d7583fd4fe https://git.kernel.org/stable/c/99d7181bca34e96fbf61bdb6844918bdd4df2814