From mboxrd@z Thu Jan 1 00:00:00 1970 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 8A63013AA2A for ; Fri, 5 Jul 2024 06:55:54 +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=1720162554; cv=none; b=UkympfbZUlmnWPVK6HJLJi9Ji81eetGLSO7CSWXErttAgtQyKyH5KSc9tkpOeJV4GQDF6EQS1lZO0yxi6MeK0LNG88WRZc8oR4b6fLC0ptagIs0dqIvuKhEwtTkgHq9ZONY2EjLF3wa8dFQhqW9HTGF8qowxtof8YnmM0I+RNKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720162554; c=relaxed/simple; bh=oSo8dFiM5HfLqJQrtEKiiCB7ly79vwkl8rd455LFQM8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ucCuxAuMygRcQbf620C2IkzJGLlw7Hwth9D/SvQm6i/haczUktxTfST5QqYb7VBEWyqcwZkZsu2jmjtiXHVJ1ublJaiDJ8+wPhTXJEsiMd+r6z1MdYZ9lBJO+T3F2oPp7tl/GEXX1MsHIXkKDgsQCBlNLB5lSzfrnZ5FRSQBffs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QkS8nUf9; 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="QkS8nUf9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10A46C116B1; Fri, 5 Jul 2024 06:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720162554; bh=oSo8dFiM5HfLqJQrtEKiiCB7ly79vwkl8rd455LFQM8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=QkS8nUf9h/qM6+I2Bba8s04lsARwcP/Sxpdghjxa9AKfl9ilrByRARFbX0M3iS92X DURW8+sVJI7sIPcKRQNHsZmTlAuJP78zR+9nBZFGegrwnbDNEuI30UuQlLWd/4s1IF Drm32MACxCMEQhx2GjmkqVUZIqLhZQ70uakNxhVQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-39483: KVM: SVM: WARN on vNMI + NMI window iff NMIs are outright masked Date: Fri, 5 Jul 2024 08:55:27 +0200 Message-ID: <2024070520-CVE-2024-39483-92bf@gregkh> X-Mailer: git-send-email 2.45.2 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=3480; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oSo8dFiM5HfLqJQrtEKiiCB7ly79vwkl8rd455LFQM8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGntM268rCl8fXxK41dl17spFmpbL4Q+2XgiZ/2/6aa+5 VWL3coXdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEVn5jWLBiit57nsdB5t6X 9v3P41A8wujsHckwT8PGoWjvsfVuFT/LG9nPcVy7lDfdFgA= 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: KVM: SVM: WARN on vNMI + NMI window iff NMIs are outright masked When requesting an NMI window, WARN on vNMI support being enabled if and only if NMIs are actually masked, i.e. if the vCPU is already handling an NMI. KVM's ABI for NMIs that arrive simultanesouly (from KVM's point of view) is to inject one NMI and pend the other. When using vNMI, KVM pends the second NMI simply by setting V_NMI_PENDING, and lets the CPU do the rest (hardware automatically sets V_NMI_BLOCKING when an NMI is injected). However, if KVM can't immediately inject an NMI, e.g. because the vCPU is in an STI shadow or is running with GIF=0, then KVM will request an NMI window and trigger the WARN (but still function correctly). Whether or not the GIF=0 case makes sense is debatable, as the intent of KVM's behavior is to provide functionality that is as close to real hardware as possible. E.g. if two NMIs are sent in quick succession, the probability of both NMIs arriving in an STI shadow is infinitesimally low on real hardware, but significantly larger in a virtual environment, e.g. if the vCPU is preempted in the STI shadow. For GIF=0, the argument isn't as clear cut, because the window where two NMIs can collide is much larger in bare metal (though still small). That said, KVM should not have divergent behavior for the GIF=0 case based on whether or not vNMI support is enabled. And KVM has allowed simultaneous NMIs with GIF=0 for over a decade, since commit 7460fb4a3400 ("KVM: Fix simultaneous NMIs"). I.e. KVM's GIF=0 handling shouldn't be modified without a *really* good reason to do so, and if KVM's behavior were to be modified, it should be done irrespective of vNMI support. The Linux kernel CVE team has assigned CVE-2024-39483 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit fa4c027a7956 and fixed in 6.6.34 with commit f79edaf73709 Issue introduced in 6.4 with commit fa4c027a7956 and fixed in 6.9.5 with commit 1d87cf2eba46 Issue introduced in 6.4 with commit fa4c027a7956 and fixed in 6.10-rc3 with commit b4bd55646747 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-2024-39483 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/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/f79edaf7370986d73d204b36c50cc563a4c0f356 https://git.kernel.org/stable/c/1d87cf2eba46deaff6142366127f2323de9f84d1 https://git.kernel.org/stable/c/b4bd556467477420ee3a91fbcba73c579669edc6