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 E2A462D047 for ; Tue, 2 Apr 2024 06:49:27 +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=1712040568; cv=none; b=pMplJkdjJoHW2wBlpGCFziwuK2KlGbRHpcxbGXDPQunT5PQsYeelYxcQR19q72B+YgKfyhc+EXriCqZzUw6P+CpYkcK9yZw/A6TK6sCcHxj4JqZRC2jGv1LXYchf/XcjSuq6U2uvw3S8GJ57hJ25mz8/xwy4jqzKTWqdppnGNf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712040568; c=relaxed/simple; bh=y5igWICpayZxCOpIPmHlYPObsKQAmppEDXh2g0AfMko=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NwxkfTIG1xyMFdiQzZup8cdYkH3G6I6nzbffE2b7981OHWHVTqjiZCXoMGa0KkmA3Fxw1bmxu0RAw8MaRV3VHDmRinKhzXCqXN9WHXdMo8wKIgQrTOR3ol7fnwc+SQvSTEhWxR/F1m0bUY3mv+xUyPXnsm17Z5qiuO80NbmUxeg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XmQTQgG/; 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="XmQTQgG/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FDDEC433A6; Tue, 2 Apr 2024 06:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712040567; bh=y5igWICpayZxCOpIPmHlYPObsKQAmppEDXh2g0AfMko=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XmQTQgG/jlIQUpSo5YUa95Fw+tZ1Hp300vwfIfUfOwCjJuPfnu3AKZ1huRmxJZqyi Ck/eDuv/pjLHeCR18nkh13XiG+38oe04Aa976npfQEzS72eyRavKYwPKlnL78Ud3iX viXRK5MQGf/EjUyBPV7BAomypyuZ9HNj00rC2KE4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52632: drm/amdkfd: Fix lock dependency warning with srcu Date: Tue, 2 Apr 2024 08:49:19 +0200 Message-ID: <2024040218-CVE-2023-52632-f7bb@gregkh> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4191; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=y5igWICpayZxCOpIPmHlYPObsKQAmppEDXh2g0AfMko=; b=owGbwMvMwCRo6H6F97bub03G02pJDGncq/Kuc1071+Sx4nzyqYa3V7tn1Enm2Fismb3u/4P0l f5FCgcud8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE6o0Y5qff+t2/sORvg/q1 HdXrVxx89e8+VwjDXMm/U0+fLXEV/1kotflVB+c3Hnft9wA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: Fix lock dependency warning with srcu ====================================================== WARNING: possible circular locking dependency detected 6.5.0-kfd-yangp #2289 Not tainted ------------------------------------------------------ kworker/0:2/996 is trying to acquire lock: (srcu){.+.+}-{0:0}, at: __synchronize_srcu+0x5/0x1a0 but task is already holding lock: ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}, at: process_one_work+0x211/0x560 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 svm_range_list_lock_and_flush_work+0x3d/0x110 [amdgpu] svm_range_set_attr+0xd6/0x14c0 [amdgpu] kfd_ioctl+0x1d1/0x630 [amdgpu] __x64_sys_ioctl+0x88/0xc0 -> #2 (&info->lock#2){+.+.}-{3:3}: __mutex_lock+0x99/0xc70 amdgpu_amdkfd_gpuvm_restore_process_bos+0x54/0x740 [amdgpu] restore_process_helper+0x22/0x80 [amdgpu] restore_process_worker+0x2d/0xa0 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 -> #1 ((work_completion)(&(&process->restore_work)->work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 __cancel_work_timer+0x12c/0x1c0 kfd_process_notifier_release_internal+0x37/0x1f0 [amdgpu] __mmu_notifier_release+0xad/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 do_exit+0x322/0xb90 do_group_exit+0x37/0xa0 __x64_sys_exit_group+0x18/0x20 do_syscall_64+0x38/0x80 -> #0 (srcu){.+.+}-{0:0}: __lock_acquire+0x1521/0x2510 lock_sync+0x5f/0x90 __synchronize_srcu+0x4f/0x1a0 __mmu_notifier_release+0x128/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 svm_range_deferred_list_work+0x19f/0x350 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 other info that might help us debug this: Chain exists of: srcu --> &info->lock#2 --> (work_completion)(&svms->deferred_list_work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&svms->deferred_list_work)); lock(&info->lock#2); lock((work_completion)(&svms->deferred_list_work)); sync(srcu); The Linux kernel CVE team has assigned CVE-2023-52632 to this issue. Affected and fixed versions =========================== Fixed in 6.1.77 with commit b602f098f716 Fixed in 6.6.16 with commit 752312f6a794 Fixed in 6.7.4 with commit 1556c242e64c Fixed in 6.8 with commit 2a9de42e8d3c 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-2023-52632 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_svm.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/b602f098f716723fa5c6c96a486e0afba83b7b94 https://git.kernel.org/stable/c/752312f6a79440086ac0f9b08d7776870037323c https://git.kernel.org/stable/c/1556c242e64cdffe58736aa650b0b395854fe4d4 https://git.kernel.org/stable/c/2a9de42e8d3c82c6990d226198602be44f43f340