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 1948C298CD2 for ; Wed, 18 Jun 2025 11:16:51 +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=1750245412; cv=none; b=YZ+7pfuvx6iPUqzxsMMyI8A5vgoJodklvhlgTJGUDafsfgE9DnlKgO7lm2TF2dEZV9fDQXCCEnpw3nOVAmkmZF6timFxi7pAJxX+Hodp7wxJIHFiEaDevDlhFqpFBQ5qi9SCIQNZH7NtTYx8ut26rlbGXrm1zMadtN8GfGQUeNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245412; c=relaxed/simple; bh=w/t//JOzBzNgJK9hAKVDPudgscJvlegGdDxgzuujD0k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=H3km4nvi+m1IxxN/PVaO/ivNgVFBazNk2xdJwLf0+atmGS8z8e6Nkgdscwry2lmYJMYOeM9x9r3qo4r9RD3KCdJY3H5vkg/dG+YaFBWMfQWoaAwBQFL4IJjsTOqEEFYoGEzL0tmyw63yDEOjPHTuhvRzYl330TjCgMFpi9l881M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0cERch1A; 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="0cERch1A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2385AC4CEE7; Wed, 18 Jun 2025 11:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245411; bh=w/t//JOzBzNgJK9hAKVDPudgscJvlegGdDxgzuujD0k=; h=From:To:Cc:Subject:Date:Reply-to:From; b=0cERch1ApZp5RR3qS8RZqj+xzTffOBAcfdqE+CKOuItW642tfYsy7vm9CNcA6/Psx VbbF8qvxIh6NqVzbhYik/ehONGZGY+9COOX1kB6vqCIzBBDX65PLSYxs46R6i/sQX4 0p+dc2H2PVtiu58GcNmM9obcwHV7EvW1KZ04rCz8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50224: KVM: x86/mmu: Treat NX as a valid SPTE bit for NPT Date: Wed, 18 Jun 2025 13:04:49 +0200 Message-ID: <2025061848-CVE-2022-50224-7549@gregkh> X-Mailer: git-send-email 2.49.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=3115; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=66YcYzJYgifYfXDcovPJoCZvmxLbtKuChnKfx3rLwHw=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc+Z0rM7s/C+08JLw8oKq2GknsnhzCmViXaXCXhiFb mM3PpXUEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABfZzrCg/8Zxv19vM/ZJ9H81 2i7nkm96avtOhnn6e5b59mam+3z7KRM9SS3vBK/UYzkA 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: KVM: x86/mmu: Treat NX as a valid SPTE bit for NPT Treat the NX bit as valid when using NPT, as KVM will set the NX bit when the NX huge page mitigation is enabled (mindblowing) and trigger the WARN that fires on reserved SPTE bits being set. KVM has required NX support for SVM since commit b26a71a1a5b9 ("KVM: SVM: Refuse to load kvm_amd if NX support is not available") for exactly this reason, but apparently it never occurred to anyone to actually test NPT with the mitigation enabled. ------------[ cut here ]------------ spte = 0x800000018a600ee7, level = 2, rsvd bits = 0x800f0000001fe000 WARNING: CPU: 152 PID: 15966 at arch/x86/kvm/mmu/spte.c:215 make_spte+0x327/0x340 [kvm] Hardware name: Google, Inc. Arcadia_IT_80/Arcadia_IT_80, BIOS 10.48.0 01/27/2022 RIP: 0010:make_spte+0x327/0x340 [kvm] Call Trace: tdp_mmu_map_handle_target_level+0xc3/0x230 [kvm] kvm_tdp_mmu_map+0x343/0x3b0 [kvm] direct_page_fault+0x1ae/0x2a0 [kvm] kvm_tdp_page_fault+0x7d/0x90 [kvm] kvm_mmu_page_fault+0xfb/0x2e0 [kvm] npf_interception+0x55/0x90 [kvm_amd] svm_invoke_exit_handler+0x31/0xf0 [kvm_amd] svm_handle_exit+0xf6/0x1d0 [kvm_amd] vcpu_enter_guest+0xb6d/0xee0 [kvm] ? kvm_pmu_trigger_event+0x6d/0x230 [kvm] vcpu_run+0x65/0x2c0 [kvm] kvm_arch_vcpu_ioctl_run+0x355/0x610 [kvm] kvm_vcpu_ioctl+0x551/0x610 [kvm] __se_sys_ioctl+0x77/0xc0 __x64_sys_ioctl+0x1d/0x20 do_syscall_64+0x44/0xa0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 ---[ end trace 0000000000000000 ]--- The Linux kernel CVE team has assigned CVE-2022-50224 to this issue. Affected and fixed versions =========================== Fixed in 5.19.2 with commit 6271f2854b9233702e236e576b885a876dde4889 Fixed in 6.0 with commit 6c6ab524cfae0799e55c82b2c1d61f1af0156f8d 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-2022-50224 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/mmu/mmu.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/6271f2854b9233702e236e576b885a876dde4889 https://git.kernel.org/stable/c/6c6ab524cfae0799e55c82b2c1d61f1af0156f8d