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
{{ message }}
Repository navigation
Ensure that system registers don't leak information between uses of a sandbox #791
Because most hypervisors treat setting up or destroying a partition as a heavy operation, reusing a Hyperlight sandbox for a different workload does not create a new partition. Traditionally, we tried to reset the state of the pre-existing partition with the evolve/devolve abstraction, which has now been replaced by snapshots.
Both approaches have focused mostly on ensuring the state of memory is reset to the expected new state, and have left resetting register state to the entry sequence for the next sandbox function that is called. On amd64, we happen to use calls that do in fact reset all general-purpose and floating point registers. However, we do not reset all system registers/MSRs/etc. Unfortunately, this means that co-operating guests (or e.g. a compromised guest and a malicious guest) could pass data between uses of a sandbox by leaving it in otherwise-unused system registers across a snapshot restore. We should (a) insofar as this is possible, disable access to system registers that we are not using in the guest and (b) ensure that every register that is available to a guest is backed up during snapshotting and restored during restore.
If we are planning on scrub on mshv and msr filtering on KVM, do we have a plan of record for WHP?
Deleting the vcpu and recreating it should be possible (and fast) on WHP, and cover more than just MSRs. I'm not sure if there is state in the VM too that needs to be reset, would need to check
Activity
jsturtevant commentedon Feb 18, 2026
progress on this was made in #1120 and we have the remaining work in #991
ludfjig commentedon Feb 19, 2026
Upcoming
HVCALL_SCRUB_PARTITIONshould help with this (on hyperv)simongdavies commentedon Mar 11, 2026
Wait for mshv crate support or add ourselves
syntactically commentedon Mar 11, 2026
If we are planning on scrub on mshv and msr filtering on KVM, do we have a plan of record for WHP?
ludfjig commentedon Mar 11, 2026
Deleting the vcpu and recreating it should be possible (and fast) on WHP, and cover more than just MSRs. I'm not sure if there is state in the VM too that needs to be reset, would need to check
ludfjig commentedon Mar 12, 2026
there's also this internal api https://docs.rs/windows-sys/latest/windows_sys/Win32/System/Hypervisor/fn.WHvResetPartition.html, which is slower than delete + recreate vcpu
syntactically commentedon Aug 3, 2026
@ludfjig @jsturtevant we should be able to close this now that #991 is in?