CVE-2025-22013 in Linuxinfo

Summary

by MITRE • 04/08/2025

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

KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state

There are several problems with the way hyp code lazily saves the host's FPSIMD/SVE state, including:

* Host SVE being discarded unexpectedly due to inconsistent configuration of TIF_SVE and CPACR_ELx.ZEN. This has been seen to result in QEMU crashes where SVE is used by memmove(), as reported by Eric Auger:

https://issues.redhat.com/browse/RHEL-68997

* Host SVE state is discarded *after* modification by ptrace, which was an unintentional ptrace ABI change introduced with lazy discarding of SVE state.

* The host FPMR value can be discarded when running a non-protected VM, where FPMR support is not exposed to a VM, and that VM uses FPSIMD/SVE. In these cases the hyp code does not save the host's FPMR before unbinding the host's FPSIMD/SVE/SME state, leaving a stale value in memory.

Avoid these by eagerly saving and "flushing" the host's FPSIMD/SVE/SME state when loading a vCPU such that KVM does not need to save any of the host's FPSIMD/SVE/SME state. For clarity, fpsimd_kvm_prepare() is removed and the necessary call to fpsimd_save_and_flush_cpu_state() is placed in kvm_arch_vcpu_load_fp(). As 'fpsimd_state' and 'fpmr_ptr' should not be used, they are set to NULL; all uses of these will be removed in subsequent patches.

Historical problems go back at least as far as v5.17, e.g. erroneous assumptions about TIF_SVE being clear in commit:

8383741ab2e773a9 ("KVM: arm64: Get rid of host SVE tracking/saving")

... and so this eager save+flush probably needs to be backported to ALL stable trees.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 10/28/2025

The vulnerability CVE-2025-22013 addresses a critical flaw in the Linux kernel's KVM implementation for arm64 architecture related to the improper handling of host Floating Point/Advanced SIMD (FPSIMD) state management. This issue stems from the hypervisor's lazy saving mechanism for host FPSIMD/SVE/SME state, which has created a series of operational failures that compromise system stability and security. The root cause lies in inconsistent state management that fails to properly account for the complex interactions between the TIF_SVE flag and CPACR_ELx.ZEN register configuration, leading to unpredictable behavior in virtualized environments.

The technical implementation flaw manifests in three primary failure modes that collectively undermine the integrity of the virtualized execution environment. First, the inconsistent configuration of TIF_SVE and CPACR_ELx.ZEN causes unexpected discarding of host SVE state, which has resulted in QEMU crashes when SVE is utilized by memory operations such as memmove(). This specific scenario creates a direct attack surface where malicious workloads could potentially exploit this instability to cause denial of service or system crashes. Second, the host SVE state is discarded after modifications made by ptrace operations, which constitutes an unintentional Application Binary Interface (ABI) change that breaks existing software expectations and potentially exposes previously secure execution contexts to unintended state modifications. Third, when running non-protected virtual machines that do not expose FPMR support to guest environments, the hypervisor fails to save the host's FPMR value before unbinding the host's FPSIMD/SVE/SME state, leaving stale values in memory that can lead to incorrect computation results or security vulnerabilities.

This vulnerability impacts the broader cybersecurity landscape by undermining the fundamental security guarantees of virtualization environments, particularly in cloud computing and containerized deployments where KVM serves as a primary virtualization backend. The flaw aligns with CWE-248 Uncontrolled Recursion and CWE-755 Improper Handling of Exceptional Conditions, as it represents a failure to properly manage exceptional execution states within the virtualization layer. From an ATT&CK framework perspective, this vulnerability could enable privilege escalation and persistence mechanisms through the exploitation of the virtualization layer's state management failures, potentially allowing adversaries to maintain access even after system reboots or normal security measures would otherwise prevent continued access.

The recommended mitigation strategy involves implementing an eager save and flush mechanism for the host's FPSIMD/SVE/SME state when loading virtual CPUs, eliminating the need for lazy saving operations that have proven unreliable. This approach directly addresses the historical problems dating back to kernel version 5.17, where erroneous assumptions about TIF_SVE flag behavior were introduced in commit 8383741ab2e773a9. The solution requires removing the fpsimd_kvm_prepare() function and placing the necessary call to fpsimd_save_and_flush_cpu_state() within kvm_arch_vcpu_load_fp(). Additionally, the fpsimd_state and fpmr_ptr variables should be set to NULL to prevent any further usage, with subsequent patches expected to completely remove all references to these variables. Given the severity and historical nature of this vulnerability, the fix should be backported to all stable kernel trees to ensure comprehensive protection across the Linux kernel ecosystem.

The operational impact of this vulnerability extends beyond immediate system stability concerns to encompass broader security implications for virtualized environments. Organizations running KVM-based virtualization systems, particularly those utilizing SVE extensions or complex floating-point workloads, face significant risks from potential exploitation of these state management flaws. The vulnerability represents a critical gap in the virtualization security model that could be leveraged by sophisticated attackers to compromise the integrity of virtualized workloads, potentially leading to data breaches, privilege escalation, or complete system compromise. Security teams should prioritize immediate deployment of patches addressing this vulnerability, particularly in environments where virtualization is heavily utilized and where the risk of exploitation through SVE or FPSIMD operations is significant.

Responsible

Linux

Reservation

12/29/2024

Disclosure

04/08/2025

Moderation

accepted

CPE

ready

EPSS

0.00162

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!