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 C97182E62A1 for ; Tue, 7 Oct 2025 15:26:11 +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=1759850771; cv=none; b=VkA6VS4UcB0L1LGX0rcGonKA9IVD/Klo5atWQDPJZKQqKxrffVpx4BJp+Eo0h2zJzu3ZXgF2itdtvMq1hDtrr5Xx52U6tsp3+/aBFv+1003zbAvkYQ75xMCvTmFqzj4Bv4BD3cV6H08bdXxKPzB5hED2LYuV+eadOFOgLzFR1Pg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850771; c=relaxed/simple; bh=rxzO3u2SFmioh3s3FEIcG46ySWyyE6udQI19JG6+b+0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BalT9x3HoQeQfW8TluP+UZfo2UWm2ZVCFyfekLDCItEWk9F38JD/Hy+aRPuJuW4OaQy3qr/2X4dJbhKmIaDxCBVZfytvQCUt8t8Cx0ODxeuZcZFQ31SnZvQBgJG/uA0+8mfhuE8MD5l9T0OXWJ8oUVWKY4yEpbH/u3v+PbGguic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f8VgKHZA; 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="f8VgKHZA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E7D7C4CEF1; Tue, 7 Oct 2025 15:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759850771; bh=rxzO3u2SFmioh3s3FEIcG46ySWyyE6udQI19JG6+b+0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=f8VgKHZAJyeUkczVzph07FyxDPbJNSVx7ewekzXQfLodcf5ey6rYw9B9K9NQrjCVJ C2x1GNPqH8nqEGXBrbstURra6ABghtDdOx2TmudsxTINyOKRcXBst3eP5j9c1BTAjM q3cfftca+v3IP8oy1ejr3yoHH03elsM5pLl17pVo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53663: KVM: nSVM: Check instead of asserting on nested TSC scaling support Date: Tue, 7 Oct 2025 17:21:22 +0200 Message-ID: <2025100703-CVE-2023-53663-0a4e@gregkh> X-Mailer: git-send-email 2.51.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=3342; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=m5J1gM5vI5cnc+a3qKbODumtZA2X5uZBk5NxW9IHufU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlP9e8/maqeuG2GufoyOz5D4xWiu1fF5DH+n/2ae3bJE gV7jjibjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIqoMM8xRypd+4aHuc9Q75 s7BKmT219kHjeYYFE7ZKGPcJGGgximTwt08SEVu4uG8CAA== 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: nSVM: Check instead of asserting on nested TSC scaling support Check for nested TSC scaling support on nested SVM VMRUN instead of asserting that TSC scaling is exposed to L1 if L1's MSR_AMD64_TSC_RATIO has diverged from KVM's default. Userspace can trigger the WARN at will by writing the MSR and then updating guest CPUID to hide the feature (modifying guest CPUID is allowed anytime before KVM_RUN). E.g. hacking KVM's state_test selftest to do vcpu_set_msr(vcpu, MSR_AMD64_TSC_RATIO, 0); vcpu_clear_cpuid_feature(vcpu, X86_FEATURE_TSCRATEMSR); after restoring state in a new VM+vCPU yields an endless supply of: ------------[ cut here ]------------ WARNING: CPU: 164 PID: 62565 at arch/x86/kvm/svm/nested.c:699 nested_vmcb02_prepare_control+0x3d6/0x3f0 [kvm_amd] Call Trace: enter_svm_guest_mode+0x114/0x560 [kvm_amd] nested_svm_vmrun+0x260/0x330 [kvm_amd] vmrun_interception+0x29/0x30 [kvm_amd] svm_invoke_exit_handler+0x35/0x100 [kvm_amd] svm_handle_exit+0xe7/0x180 [kvm_amd] kvm_arch_vcpu_ioctl_run+0x1eab/0x2570 [kvm] kvm_vcpu_ioctl+0x4c9/0x5b0 [kvm] __se_sys_ioctl+0x7a/0xc0 __x64_sys_ioctl+0x21/0x30 do_syscall_64+0x41/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x45ca1b Note, the nested #VMEXIT path has the same flaw, but needs a different fix and will be handled separately. The Linux kernel CVE team has assigned CVE-2023-53663 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 5228eb96a4875f8cf5d61d486e3795ac14df8904 and fixed in 6.1.54 with commit 6c1ecfea1daf6e75c46e295aad99dfbafd878897 Issue introduced in 5.16 with commit 5228eb96a4875f8cf5d61d486e3795ac14df8904 and fixed in 6.5.4 with commit 02b24270568f65dd607c4a848512dc8055b4491b Issue introduced in 5.16 with commit 5228eb96a4875f8cf5d61d486e3795ac14df8904 and fixed in 6.6 with commit 7cafe9b8e22bb3d77f130c461aedf6868c4aaf58 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-53663 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/nested.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/6c1ecfea1daf6e75c46e295aad99dfbafd878897 https://git.kernel.org/stable/c/02b24270568f65dd607c4a848512dc8055b4491b https://git.kernel.org/stable/c/7cafe9b8e22bb3d77f130c461aedf6868c4aaf58