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 9026F143735 for ; Tue, 21 May 2024 15:07:00 +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=1716304020; cv=none; b=H4hn7iQ2i3KZPL/Vwi94fACHW2aq4Acc7X/MNav802DyW0cVH0kgvsR9vwq9jBOyyAtDV+jz3fBPM0/TbtxFOsoi8/CDcvjvXqvmSJkIiM/4DhLVf+VgFf8zH59Mejt3otlxy+fFbQf3TBLJYfZ/w/IKaalvtWfB0noAFMrFE2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716304020; c=relaxed/simple; bh=xBLNZi1zQAnuY5wHGxJ0YtmA6R0cOJelenmPxEkJzWw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EZaIkc/ogZDkXqupQqNIDM/uCQVZW+GadB6Lm+JbuHcxD0tbeSkuRciyKGxm+Q5oXiqBiKmdtHsKpwkPMMZ808Nt4FyB6qqSMh+DCXq1qq+B7/MvOZaGLfuCDavGWwei8/aPXdyX0fxquNWrlrnf1fdA4aPsLbmC4a537PbPrKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wUHvmbBR; 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="wUHvmbBR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17CEDC2BD11; Tue, 21 May 2024 15:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716304020; bh=xBLNZi1zQAnuY5wHGxJ0YtmA6R0cOJelenmPxEkJzWw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=wUHvmbBRwB8ObOnHpBJtmuXh+zELtH3st68LIOIOQvFtvB2iRFgWhVIj0EyWtb9M9 Yy3ykgpsbFWEe0oD0lYeix7Ki2u4o4iZkP6bdgNPInzMmpLE/gbkz8BgaTBb2Bzwt5 BDVLHaJsoZU2Z9uZUxNLXSKqIV+WG46rkjoXb7lw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47421: drm/amdgpu: handle the case of pci_channel_io_frozen only in amdgpu_pci_resume Date: Tue, 21 May 2024 17:04:38 +0200 Message-ID: <2024052155-CVE-2021-47421-00f1@gregkh> X-Mailer: git-send-email 2.45.1 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=2370; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xBLNZi1zQAnuY5wHGxJ0YtmA6R0cOJelenmPxEkJzWw=; b=kA0DAAIRMUfUDdst+ykByyZiAGZMt9ugiwINwvXRn6sKzhEzmnAJEUJhyVhFb4kKyIgUN7Nwm 4hdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmZMt9sACgkQMUfUDdst+ynuFACgzRm2 IbshsqqdgrgRyDfBuk1lwtEAn2K5PExACpO2XJ6xJdLLYqnLofVD 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/amdgpu: handle the case of pci_channel_io_frozen only in amdgpu_pci_resume In current code, when a PCI error state pci_channel_io_normal is detectd, it will report PCI_ERS_RESULT_CAN_RECOVER status to PCI driver, and PCI driver will continue the execution of PCI resume callback report_resume by pci_walk_bridge, and the callback will go into amdgpu_pci_resume finally, where write lock is releasd unconditionally without acquiring such lock first. In this case, a deadlock will happen when other threads start to acquire the read lock. To fix this, add a member in amdgpu_device strucutre to cache pci_channel_state, and only continue the execution in amdgpu_pci_resume when it's pci_channel_io_frozen. The Linux kernel CVE team has assigned CVE-2021-47421 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit c9a6b82f45e2 and fixed in 5.14.12 with commit 72e9a1bf9b72 Issue introduced in 5.10 with commit c9a6b82f45e2 and fixed in 5.15 with commit 248b061689a4 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-2021-47421 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.h drivers/gpu/drm/amd/amdgpu/amdgpu_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/72e9a1bf9b722628c28092e0c2cd8717edd201dc https://git.kernel.org/stable/c/248b061689a40f4fed05252ee2c89f87cf26d7d8