Skip to content

Disallow MSR read/writes#991

Draft
ludfjig wants to merge 2 commits into
hyperlight-dev:mainfrom
ludfjig:reset2
Draft

Disallow MSR read/writes#991
ludfjig wants to merge 2 commits into
hyperlight-dev:mainfrom
ludfjig:reset2

Conversation

@ludfjig

@ludfjig ludfjig commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

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_FILTER vm ioctl that this PR depends on, see rust-vmm/kvm#359

@ludfjig
ludfjig force-pushed the reset2 branch 7 times, most recently from aeca04d to 968f2f4 Compare October 31, 2025 00:29
@ludfjig ludfjig added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Dec 2, 2025
@ludfjig
ludfjig force-pushed the reset2 branch 3 times, most recently from e859ff9 to e793129 Compare December 8, 2025 18:42
@ludfjig ludfjig changed the title Reset more state when restoring snapshot Reset MSRs when restoring snapshot Dec 18, 2025
@ludfjig ludfjig changed the title Reset MSRs when restoring snapshot Disallow MSR read/writes Feb 10, 2026
@ludfjig
ludfjig force-pushed the reset2 branch 5 times, most recently from 8f55249 to 3bb2294 Compare February 13, 2026 23:16
@ludfjig
ludfjig force-pushed the reset2 branch 2 times, most recently from 032168d to c0383dd Compare February 18, 2026 19:27
@ludfjig
ludfjig force-pushed the reset2 branch 6 times, most recently from 2e98073 to 089227c Compare July 11, 2026 07:10
@ludfjig
ludfjig force-pushed the reset2 branch 7 times, most recently from d98fa0d to db219bc Compare July 13, 2026 22:25
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig
ludfjig force-pushed the reset2 branch 10 times, most recently from 4cef9d5 to 4b942f8 Compare July 16, 2026 20:30
Guest reads and writes of model-specific registers are denied by default. SandboxConfiguration::allow_msr and allow_msrs permit specific MSRs.

KVM enforces the boundary with a deny-by-default MSR filter. MSHV and WHP have no per-MSR filter, so a guest access to an unallowed MSR faults directly. On those backends isolation comes from capturing the retained MSR state at VM creation and resetting it on restore.

Captured MSR state persists through OCI snapshots and reloads on restore. A denied access poisons the sandbox. KVM reports the MSR index. MSHV and WHP surface a guest general protection fault.

See docs/msr.md.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant