CVE-2025-22013: KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state
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 TIFSVE and CPACRELx.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, fpsimdkvmprepare() is removed and the necessary call to fpsimdsaveandflushcpustate() is placed in kvmarchvcpuloadfp(). As 'fpsimdstate' and 'fpmrptr' 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 TIFSVE 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
KVM: arm64to a version that resolves this vulnerability.Patch 8383741ab2e773a9 - Upgrade
Upgrade
KVM: arm64to a version that resolves this vulnerability.Patch KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state - Compensating control
If running a non-protected VM where host FPMR support is not exposed to the VM, the host FPMR value can be discarded (avoid relying on host FPMR persistence).
- Compensating control
Mitigate the QEMU crash scenario where SVE is used by memmove by ensuring eager save+flush of the host FPSIMD/SVE/SME state is applied/available in the KVM arm64 implementation (backport to stable trees as needed).
- Compensating control
Avoid ptrace-related inconsistent host SVE state discard by applying the eager save+flush approach so host FPSIMD/SVE/SME state is not discarded after ptrace modification.
- Operational
If you previously relied on lazy discarding/saving of host FPSIMD/SVE/SME state, validate vCPU loading behavior (in kvm_arch_vcpu_load_fp()) after applying the unconditionally save+flush change to ensure no stale TIF_SVE/CPACR_ELx.ZEN configuration remains.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-22013?
CVE-2025-22013 is considered a high severity vulnerability due to its potential impact on the integrity of the host's FPSIMD/SVE state.
What does CVE-2025-22013 affect?
CVE-2025-22013 affects the Linux kernel versions starting from 5.17.
How do I fix CVE-2025-22013?
To fix CVE-2025-22013, you should update your Linux kernel to the latest version where the vulnerability has been patched.
What are the risks of not addressing CVE-2025-22013?
Failing to address CVE-2025-22013 could lead to stability issues and potential data corruption affecting the host's FPSIMD/SVE state.
Is CVE-2025-22013 a remote vulnerability?
CVE-2025-22013 is not considered a remote vulnerability, as it requires local access to the affected system to exploit.