Re: [PATCH] KVM: x86: Zero-initialize temporary fxregs_state buffers in FXSAVE emulation
From: Sean Christopherson
Date: Thu Mar 05 2026 - 12:14:00 EST
On Thu, 12 Feb 2026 22:24:04 +0100, Uros Bizjak wrote:
> Explicitly zero-initialize stack-allocated struct fxregs_state
> variables in em_fxsave() and fxregs_fixup() to ensure all padding and
> unused fields are cleared before use.
>
> Both functions declare temporary fxregs_state buffers that may be
> partially written by fxsave. Although the emulator copies only the
> architecturally defined portion of the state to userspace, any padding
> or otherwise untouched bytes in the structure can remain uninitialized.
> This can lead to the use of uninitialized stack data and may trigger
> KMSAN reports. In the worst case, it could result in leaking stack
> contents if such bytes are ever exposed.
>
> [...]
Applied to kvm-x86 misc, thanks!
[1/1] KVM: x86: Zero-initialize temporary fxregs_state buffers in FXSAVE emulation
https://github.com/kvm-x86/linux/commit/e1df128dc00b
--
https://github.com/kvm-x86/linux/tree/next