Repository navigation
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
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) (➖ stable)No benchmark improved or regressed. 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 |
be8b588 to
925741c
Compare
| self.g2h_consumer = None; | ||
| self.h2g_consumer = None; | ||
|
|
||
| // A panic during restricted dispatch can skip the mode reset. |
There was a problem hiding this comment.
I'm probably missing something obvious, but why can this happen? I see that dispatch_guest_call_restricted will still do the reset even if dispatch_guest_call returns Err(...), and I thought a guest call would show up there as Err(HyperlightError::GuestAborted(...)).
There was a problem hiding this comment.
This is referring to panic in host. But yeah as I don't think we have any promises if host panics, this might be overly cautions.
Keep transport pools and aliases stable. Pin pages backing live buffers and exclude overlapping slots until a checkpoint finds those pages empty. Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
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>
925741c to
926a925
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.
Closes: #1883