Repository navigation
feat: restrict guest capabilities during snapshot checkpoint - #1896
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open findings
VirtqSnapshot::capture(...)is invoked purely for validation and its result is discarded. If… · Newdispatch_guest_call_restrictedalways restores the mode toUnrestricted, which can silently… · New This introduces new security/behavioral enforcement (rejecting guest host-function calls during… · New This error lacks actionable context for debugging (e.g., which host function ID/name was attempted,… · New
What changed in this PR
Introduces a host-side execution mode to restrict what guest operations are accepted during snapshot checkpointing, primarily to prevent guest→host function calls during the checkpoint window.
Changes:
- Added
ExecutionModetoSandboxMemoryManagerand threaded it into outbound virtqueue handling. - Switched snapshot checkpoint dispatch to a restricted guest-execution path.
- Added post-checkpoint validation of virtqueue/mailbox state and documented the behavior in the changelog.
| File | Description |
|---|---|
| src/hyperlight_host/src/sandbox/outb.rs | Rejects guest host-function requests during restricted execution mode. |
| src/hyperlight_host/src/sandbox/initialized.rs | Dispatches guest execution in restricted mode during snapshot checkpointing. |
| src/hyperlight_host/src/mem/mgr.rs | Adds ExecutionMode state and validates virtqueues/mailbox after checkpoint. |
| CHANGELOG.md | Documents restricted host-call behavior and added validation during checkpoints. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment has been minimized.
This comment has been minimized.
942a49b to
8c55f9d
Compare
This comment has been minimized.
This comment has been minimized.
ludfjig
left a comment
There was a problem hiding this comment.
lgtm. Should we prevent any other outb as well you think or is this sufficient? (debug print, tracing)?
There was a problem hiding this comment.
Actually I think we need to reset the mode in restore(). If dispatch panics during the checkpoint, the reset line is skipped and the sandbox stays Restricted even after a restore. Maybe a test for this would be good as well (unless hard to repro).
8c55f9d to
be8b588
Compare
This comment has been minimized.
This comment has been minimized.
be8b588 to
925741c
Compare
925741c to
926a925
Compare
926a925 to
fa74cb3
Compare
This comment has been minimized.
This comment has been minimized.
fa74cb3 to
dd56e29
Compare
This comment has been minimized.
This comment has been minimized.
f5071cc to
f6b869b
Compare
This patch introduces the execution mode on the host and allows call guest function and prohibit the guest to call host functions. The only user of this mode is snapshotting for now. Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
f6b869b to
b2e8495
Compare
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (❌ 2.05x)Top regressions
Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |


This patch introduces the execution mode on the host and allows call guest function and prohibit the guest to call host functions. The only user of this mode is snapshotting for now.
Closes: #1883