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 10D1225625 for ; Wed, 28 Feb 2024 08:16:32 +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=1709108193; cv=none; b=qTawZ0oNAit7WbQ7c+E69FiooyEbdROX8Etky+7ixQ3RAKWP5z4oFqi8x6Cyx0HuZhLEvOMEYHCqUu9z9D/C4OCrNK49UTtzgCoby2r/ixrKOitjIA22BsWScNVAuDPT655XJI2sCYb8rd1Jc5yS2pG2ozFKFnwkpEf7JKSpMxY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709108193; c=relaxed/simple; bh=e7LX5+TfgVi/QTj8OcLj9XwaKV7tZdmNsQ941S2bsrM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YvwS++09l1R20oEB1mg1vx2cLwoMwPxsQ3WC4tstR4ZRyqe1DTjf9DeOrSnZ5w/58gk0SHFNLQr/z2HmaxWNrx6f446kBS9eS5wECY67j/yQBn/tLXO/bxIyO51FdGed0T+aJAOW5BfKHHXUAUWdGfaUhqGNAFf/O/pDEx3aPMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b1wPR0X1; 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="b1wPR0X1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D8B5C433C7; Wed, 28 Feb 2024 08:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709108192; bh=e7LX5+TfgVi/QTj8OcLj9XwaKV7tZdmNsQ941S2bsrM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=b1wPR0X1BkDQpq8n245JmDaS/eXhLhNnZJyxijELmHQTb4hLb+Tq02mPICbO0AmO3 2KxsNrJEzgXwCx1wXeqkUXRREw3fUOZ3RD1XOI9S6JBlqqTmqnoS5DtOmDUKMisd56 7ILUxQOXuXedFpQlDD+9F9qBSv+w2ywEwIFEItj8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: gregkh@kernel.org Subject: CVE-2021-47008: KVM: SVM: Make sure GHCB is mapped before updating Date: Wed, 28 Feb 2024 09:14:58 +0100 Message-ID: <2024022830-CVE-2021-47008-3dc3@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=2648; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=WqPyhiducWfjWna0XuzuEHPNJywNjI197i/afSSB2WY=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn3XqdNl4lvezRr2hzd51o3Zuz7K9/E3haYe2dObuRHs bNz29OsOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiC9kY5pmlq6v4Rh+fnvT1 3a5d7TuWe54Wq2dYsOHdDoOnF1o9731Yv3QH30UR1wOfLwEA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: gregkh@kernel.org Description =========== In the Linux kernel, the following vulnerability has been resolved: KVM: SVM: Make sure GHCB is mapped before updating Access to the GHCB is mainly in the VMGEXIT path and it is known that the GHCB will be mapped. But there are two paths where it is possible the GHCB might not be mapped. The sev_vcpu_deliver_sipi_vector() routine will update the GHCB to inform the caller of the AP Reset Hold NAE event that a SIPI has been delivered. However, if a SIPI is performed without a corresponding AP Reset Hold, then the GHCB might not be mapped (depending on the previous VMEXIT), which will result in a NULL pointer dereference. The svm_complete_emulated_msr() routine will update the GHCB to inform the caller of a RDMSR/WRMSR operation about any errors. While it is likely that the GHCB will be mapped in this situation, add a safe guard in this path to be certain a NULL pointer dereference is not encountered. The Linux kernel CVE team has assigned CVE-2021-47008 to this issue. Affected and fixed versions =========================== Issue introduced in 5.11 with commit 647daca25d24 and fixed in 5.11.22 with commit fb9e14f4f821 Issue introduced in 5.11 with commit 647daca25d24 and fixed in 5.12.5 with commit fd722a57fe0b Issue introduced in 5.11 with commit 647daca25d24 and fixed in 5.13 with commit a3ba26ecfb56 Please see https://www.kernel.org or 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-47008 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: arch/x86/kvm/svm/sev.c arch/x86/kvm/svm/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/fb9e14f4f8217a0980f8da2c8ff70dee058cbe47 https://git.kernel.org/stable/c/fd722a57fe0b80133dacae4e1c852ee4212f9b2e https://git.kernel.org/stable/c/a3ba26ecfb569f4aa3f867e80c02aa65f20aadad