You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C `kvm_xsave` strut was extended to have a flexible array member
(FAM) at the end in Linux 5.17. The size can vary depending on features
that have been dynamically enabled via `arch_prctl()` and the required
size can be retrieved via `KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2)`. That
means `KVM_SET_XSAVE` may copy data beyond the size of the traditional C
`kvm_xsave` struct (i.e. 4096 bytes) now, possibly causing undefined
behavior.
It is safe if used on Linux prior to 5.17, if no XSTATE features are
enabled dynamically or if the required size is still within the
traditional 4096 bytes even with dynamically enabled features. However,
if any features are enabled dynamically, it is recommended to use
`set_xsave2()` instead.
Signed-off-by: Takahiro Itazuri <[email protected]>
0 commit comments