CVE-2025-37957 in Linuxinfo

Summary

by MITRE • 05/20/2025

In the Linux kernel, the following vulnerability has been resolved:

KVM: SVM: Forcibly leave SMM mode on SHUTDOWN interception

Previously, commit ed129ec9057f ("KVM: x86: forcibly leave nested mode on vCPU reset") addressed an issue where a triple fault occurring in nested mode could lead to use-after-free scenarios. However, the commit did not handle the analogous situation for System Management Mode (SMM).

This omission results in triggering a WARN when KVM forces a vCPU INIT after SHUTDOWN interception while the vCPU is in SMM. This situation was reprodused using Syzkaller by:

1) Creating a KVM VM and vCPU 2) Sending a KVM_SMI ioctl to explicitly enter SMM 3) Executing invalid instructions causing consecutive exceptions and eventually a triple fault

The issue manifests as follows:

WARNING: CPU: 0 PID: 25506 at arch/x86/kvm/x86.c:12112 kvm_vcpu_reset+0x1d2/0x1530 arch/x86/kvm/x86.c:12112 Modules linked in: CPU: 0 PID: 25506 Comm: syz-executor.0 Not tainted 6.1.130-syzkaller-00157-g164fe5dde9b6 #0 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:kvm_vcpu_reset+0x1d2/0x1530 arch/x86/kvm/x86.c:12112 Call Trace: <TASK> shutdown_interception+0x66/0xb0 arch/x86/kvm/svm/svm.c:2136 svm_invoke_exit_handler+0x110/0x530 arch/x86/kvm/svm/svm.c:3395 svm_handle_exit+0x424/0x920 arch/x86/kvm/svm/svm.c:3457 vcpu_enter_guest arch/x86/kvm/x86.c:10959 [inline]
vcpu_run+0x2c43/0x5a90 arch/x86/kvm/x86.c:11062 kvm_arch_vcpu_ioctl_run+0x50f/0x1cf0 arch/x86/kvm/x86.c:11283 kvm_vcpu_ioctl+0x570/0xf00 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4122 vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__x64_sys_ioctl+0x19a/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x35/0x80 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x6e/0xd8

Architecturally, INIT is blocked when the CPU is in SMM, hence KVM's WARN() in kvm_vcpu_reset() to guard against KVM bugs, e.g. to detect improper emulation of INIT. SHUTDOWN on SVM is a weird edge case where KVM needs to do _something_ sane with the VMCB, since it's technically undefined, and INIT is the least awful choice given KVM's ABI.

So, double down on stuffing INIT on SHUTDOWN, and force the vCPU out of SMM to avoid any weirdness (and the WARN).

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

[sean: massage changelog, make it clear this isn't architectural behavior]

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 07/31/2026

The vulnerability CVE-2025-37957 affects the Linux kernel's KVM (Kernel-based Virtual Machine) implementation, specifically within the SVM (Secure Virtual Machine) module used for AMD virtualization. This issue stems from an incomplete fix for a similar problem in nested virtualization mode, where a triple fault condition could lead to use-after-free scenarios. While the previous commit ed129ec9057f addressed this problem for nested mode, it failed to account for the analogous situation occurring in System Management Mode (SMM), creating a gap in the kernel's virtualization security model. The vulnerability manifests when KVM attempts to forcibly reset a vCPU after a SHUTDOWN interception while the vCPU is in SMM state, triggering a kernel warning that indicates improper handling of the virtual CPU state transition.

The technical flaw occurs during the handling of SHUTDOWN interception in SVM virtualization environments. When a virtual CPU enters SMM state through explicit SMI (System Management Interrupt) injection, and subsequent invalid instructions cause consecutive exceptions leading to a triple fault, the kernel's KVM subsystem attempts to reset the vCPU using INIT signal. However, this operation is architecturally blocked when the CPU is in SMM state, as INIT instructions are explicitly disabled during SMM execution. The kernel's current implementation does not properly handle this scenario, resulting in a warning message in the kernel log that originates from the kvm_vcpu_reset function at line 12112 in arch/x86/kvm/x86.c, indicating a potential bug in the virtualization layer's state management. This condition specifically occurs during the shutdown_interception handler in the SVM module, where the system attempts to process the exit handler and eventually calls vcpu_enter_guest, ultimately leading to the problematic reset operation.

The operational impact of this vulnerability lies in the potential for kernel instability and debugging complications within virtualized environments. The warning message indicates a situation that could compromise the integrity of the virtual machine monitor, as it suggests improper handling of CPU state transitions during critical virtualization events. While the vulnerability does not directly enable privilege escalation or arbitrary code execution, it represents a subtle but significant flaw in the kernel's virtualization subsystem that could be exploited by attackers to cause denial-of-service conditions or to uncover additional vulnerabilities through kernel debugging. The issue was discovered using Syzkaller, a kernel fuzzer, which systematically tests kernel behavior under various edge cases, demonstrating that the problem can be reliably reproduced through specific sequences of virtual machine operations involving SMI injection and instruction execution that lead to triple faults. This makes the vulnerability particularly concerning for production environments where stability and reliability of virtualized systems are paramount.

The fix for this vulnerability involves modifying the SHUTDOWN interception handler to forcibly exit SMM mode before attempting the vCPU reset operation, ensuring that the INIT signal can be properly delivered without triggering the kernel warning. This approach addresses the root cause by recognizing that while INIT is blocked in SMM, the system must still perform some action to maintain proper virtual machine state management, with the least disruptive option being to exit SMM mode first. The solution follows established security principles by ensuring proper state transitions and preventing improper emulation of CPU instructions within virtualized environments. This fix aligns with the ATT&CK framework's concept of privilege escalation through kernel exploitation, as it addresses a potential entry point for attackers seeking to exploit virtualization layer vulnerabilities. The vulnerability also relates to CWE-399, which covers resource management flaws, as it involves improper handling of virtual CPU resources during state transitions. The Linux kernel's verification process, including contributions from the Linux Verification Center, ensures that such edge case scenarios are properly addressed, maintaining the overall security and stability of the virtualization infrastructure that supports modern cloud computing and containerization technologies.

Responsible

Linux

Reservation

04/16/2025

Disclosure

05/20/2025

Moderation

accepted

EPSS

0.00193

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!