Disallow MSR read/writes#991
Draft
ludfjig wants to merge 3 commits into
Draft
Conversation
aeca04d to
968f2f4
Compare
e859ff9 to
e793129
Compare
8f55249 to
3bb2294
Compare
032168d to
c0383dd
Compare
2e98073 to
089227c
Compare
444a5eb to
d98fa0d
Compare
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Add an MSHV-only probe that checks whether a host write of HV_X64_REGISTER_TSC resets a guest-shifted TSC, deciding if the raw-TSC leak can be closed by reset. Broaden the test-only MSR helpers to MSHV. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Reset the raw TSC (0x10) on every backend. Hyper-V models TSC and TSC_ADJUST as independent registers, so a guest WRMSR(TSC) is not folded into TSC_ADJUST and resetting TSC_ADJUST alone leaves the shift in place. Deny is not possible on the filterless backends because Hyper-V refuses a root MSR intercept for an implemented MSR, so reset is the only lever. Add TSC to the KVM reset core too, purely for cross-backend consistency, so a restore rewinds the guest clock uniformly. The KVM filter still denies guest TSC writes, so nothing leaks there. Document the full rationale in docs/msr.md. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disallows reading/writing MSRs in the guest. The goal is to prevent guest state to persist across snapshot-restores.
Will mark ready for review once KVM releases new version, which should include newly added
KVM_X86_SET_MSR_FILTERvm ioctl that this PR depends on, see rust-vmm/kvm#359