Repository navigation
Description
Summary
The architecture guide (#529) now identifies every bound sandbox block, the read-only layers and paired scratch.img, only by a caller-supplied storage generation, and states that the VMM never reads an artifact or block to verify its contents. OpenVMM still defaults to whole-file SHA-256 block identity. Remove it, so neither capture nor restore hashes block artifacts.
Why
- Every hash is a full read, on the capture and restore paths. With the default
sha256identity:- Capture hashes every bound block (
capture_snapshot_block_contract), and publication hashes the publishedscratch.imgagain. - Restore hashes
scratch.imgwhen it opens the file, again before it materializes it, and then the resulting private copy, clone, or link. It then rebuilds the block contract (restore_snapshot_block_contract) by hashing every attached block: the supplied read-only layers, and the materialized scratch a fourth time. The default private-copy policy also copies the scratch. - A
platformcapture hashes every read-only layer and then discards the digests, because platform layers are recorded asunbound.
- Capture hashes every bound block (
- The digest is not the integrity boundary. The manifest carries no checksums for
state.binormemory.bin, artifact integrity already relies on host access control, and the proposed trusted-storage design, which doc: replace doc/design with an architecture-only design guide #529 removed, relied on an authenticated storage generation, leaving SHA-256 to export or deep verification outside the VMM.
Where SHA-256 identity lives
OpenVMM (openvmm/ submodule; paths relative to it):
openvmm/openvmm_entry/src/cli_args/microvm.rs:SnapshotBlockIdentityCli(defaultSha256),--snapshot-block-identity, and the rule that--snapshot-generation-idcomes only withgeneration.openvmm/openvmm_entry/src/storage_builder/microvm.rs:capture_snapshot_block_contractandrestore_snapshot_block_contractcallfile_sha256.openvmm/openvmm_entry/src/vm_controller/microvm.rs:platformcaptures hash the layers and then clear their identities.openvmm/openvmm_helpers/src/snapshot/publish.rs: hashes the publishedscratch.img.openvmm/openvmm_helpers/src/snapshot/restore.rs:verify_sandbox_block_identity, the three paired-scratch materializers, and the unusedcopy_verified_file.openvmm/openvmm_entry/src/microvm/restore.rsandopenvmm/openvmm_entry/src/microvm/launch.rs: the restore path that verifies, materializes, and then re-hashes paired scratch.openvmm/openvmm_helpers/src/snapshot/microvm.rs:SNAPSHOT_BLOCK_IDENTITY_SHA256in manifest validation.Guide/src/dev_guide/snapshot_format.md,Guide/src/user_guide/openvmm/snapshots.md, andGuide/src/reference/openvmm/management/cli.md.
NVX:
scripts/nvx_tools/microvm_tests.py:scratch-snapshotcaptures with the defaultsha256and expects restore to reject a same-length wrong layer and ascratch.imgwith one flipped byte;snapshot-tierspasses--snapshot-block-identity generationand relies on the default for itsplatformtier.scripts/test_microvm_tests.py: the expected tier capture arguments.
Decisions
- Existing snapshots. Manifest version 6 accepts
sha256identities. Decide whether restore rejects them and asks for a recapture, or keeps verifying them for a transition period. - Generation source. Captures that bind blocks (
workload-startandinstance-checkpoint) would always need--snapshot-generation-id. Decide who supplies it where no storage control plane exists, such asnvx.pyand the test harness. - Restore-time check. Restore currently trusts the generation in the manifest and takes none from the caller. Decide whether the caller should state the generation it supplies, so restore can reject a snapshot paired with the wrong storage.
- Same-length changes. Without a digest, restore no longer detects a same-length change to a bound layer or to
scratch.img; the storage owner's generation is the only binding. Confirm that this is acceptable, or decide where deep verification lives.
Tasks
- OpenVMM: remove the
sha256block identity and--snapshot-block-identity, require a storage generation for captures that bind blocks, stop hashing blocks at capture, publication, and restore, removecopy_verified_file, and update the tests and the Guide. - NVX: promote the OpenVMM pin.
- Tests: move
scratch-snapshotto generation identity and replace its same-length corruption checks with structural ones, and drop the identity flag fromsnapshot-tiers. - Docs: doc: replace doc/design with an architecture-only design guide #529 removed the old
doc/design/chapters, and the architecture guide that replaced them already describes generation-only identity. No other NVX document describes block identity.
Metadata
Metadata
Assignees
Labels
No labels
Activity
doc: add an architecture-only design guide in doc/design-doc
microVM: identify snapshot blocks only by storage generation
microVM: check the storage generation of a restore's sandbox blocks
openvmm: identify snapshot blocks only by storage generation
microVM: identify snapshot blocks only by storage generation
microVM: check the storage generation of a restore's sandbox blocks