Retain page table root finder for in-memory snapshots - #1730
Open
ludfjig wants to merge 1 commit into
Open
Conversation
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
from
August 12, 2026 18:11
3066727 to
369449c
Compare
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
from
August 12, 2026 18:59
369449c to
7594cc8
Compare
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
from
August 12, 2026 23:08
7594cc8 to
90f3e0d
Compare
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
from
August 13, 2026 19:46
90f3e0d to
e68e972
Compare
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
from
August 13, 2026 21:13
e68e972 to
34faa8e
Compare
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
2 times, most recently
from
August 13, 2026 22:44
5e7ba67 to
85d03c4
Compare
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
from
August 18, 2026 00:54
85d03c4 to
454ea47
Compare
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
ludfjig
force-pushed
the
ll/snapshot-restore-retain-pt-root-finder
branch
from
August 18, 2026 01:20
454ea47 to
1a6288c
Compare
ludfjig
marked this pull request as ready for review
August 18, 2026 01:23
ludfjig
requested review from
danbugs,
dblnz,
devigned,
jprendes,
jsturtevant,
simongdavies and
syntactically
as code owners
August 18, 2026 01:23
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a correctness issue in the host snapshot/restore pipeline where restoring a snapshot into a different sandbox could accidentally keep the target sandbox’s page-table root finder (or lose the source guest’s finder), leading to later snapshots walking the wrong page-table roots. The fix applies to in-memory snapshots only (the finder remains non-serializable for on-disk snapshots).
Changes:
- Plumbs an optional runtime-only
pt_root_finderthroughSnapshotso in-memory snapshots retain it acrossfrom_snapshotandrestore. - Updates
PtRootFindertoArc<... + Send + Sync>and wires it through snapshot creation/restoration paths. - Adds tests and documentation clarifying that
PtRootFinderis not serialized for file-backed snapshots, plus a changelog entry for the breaking API change.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/hyperlight_host/src/sandbox/snapshot/mod.rs | Adds pt_root_finder to in-memory Snapshot and a crate-level accessor. |
| src/hyperlight_host/src/sandbox/snapshot/file/mod.rs | Documents that PtRootFinder is not serialized for on-disk snapshots; initializes loaded snapshots with pt_root_finder: None. |
| src/hyperlight_host/src/sandbox/snapshot/file_tests.rs | Extends snapshot round-trip tests to validate in-memory retention and on-disk non-serialization of the finder. |
| src/hyperlight_host/src/sandbox/initialized_multi_use.rs | Switches PtRootFinder to Arc + Sync, propagates it across from_snapshot/restore, and adds thread-safety tests. |
| src/hyperlight_host/src/mem/mgr.rs | Passes optional finder through to Snapshot::new. |
| CHANGELOG.md | Records the breaking change to PtRootFinder (Arc + Sync). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
restoring a snapshot into another sandbox could retain the target sandbox’s finder or lose the source guest’s finder. Later snapshots might then discover the wrong page-table roots. This pr fixes that (for in-memory snapshots only as the pt-finder cannot be serialized to disk)