You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
openvmm: opening a snapshot with an unknown paired-scratch restore mode panics #1361
Opening a microVM snapshot whose paired scratch block has a restore_mode this OpenVMM does not know hits an unreachable! instead of returning an "unsupported" error. OpenVMM builds with panic = 'abort', so the process aborts, before any VM is built. Only a manifest this OpenVMM did not write reaches it (corrupted, crafted, or from a newer version with a new mode), through --restore-snapshot or a management-RPC CreateVm with a restore_path.
Reproduction
Take a valid paired-scratch snapshot, set the restore_mode of its scratch block (the sandbox block whose artifact is scratch.img) to "a-future-restore-mode", and call OpenedSnapshot::open on the directory. It should fail with "snapshot scratch restore mode 'a-future-restore-mode' is unsupported"; it panics with "internal error: entered unreachable code: machine-contract shape validation rejects unknown restore modes". The test unknown_paired_scratch_restore_mode_is_rejected_on_open that fix.patch adds does exactly this, and fails before the fix.
Cause
validate_snapshot_tier assumes that the machine-contract shape check has already rejected unknown modes:
fix.patch replaces the arm with mode => anyhow::bail!("snapshot scratch restore mode '{mode}' is unsupported"), the shape check's own message. It leaves the validation order unchanged, so every other malformed manifest still gets the same first error. The test (in openvmm_helpers' restore.rs) asserts that open returns this error, and that validate_machine_contract_shape gives the same text for the same manifest.
Activity
tangruize commentedon Nov 8, 2026
Proposed patch
Patch against OpenVMM 3cf58a5234ed824435825c9f87187f5129219724. Save the contents below as
fix.patchand rungit apply fix.patch.fix.patchopenvmm: pin refusing an unknown paired-scratch restore mode
openvmm_helpers: refuse an unknown paired-scratch restore mode
openvmm: pin refusing an unknown paired-scratch restore mode
openvmm_helpers: refuse an unknown paired-scratch restore mode