feat: spot-check integrity verification for extension images#13
Merged
mobileoverlord merged 5 commits intomainfrom Mar 29, 2026
Merged
feat: spot-check integrity verification for extension images#13mobileoverlord merged 5 commits intomainfrom
mobileoverlord merged 5 commits intomainfrom
Conversation
Add integrity verification for extension images during runtime staging and installation. Previously only file existence was checked, allowing corrupted or partial images to pass validation silently. - Add sha256 field to ManifestExtension (optional, backward-compatible) - Add shared hash module with streaming SHA256 file hashing - validate_manifest_images() now verifies hashes when present - install_images_from_staging() verifies hashes after copy and for existing images - OS bundle hash is now also verified during manifest validation - Update varlink interface and service types to expose sha256 field
Display a short SHA256 prefix (12 chars) in the extension table and full hashes in verbose mode, making it easy to verify that a runtime includes hash-validated extensions.
Add a fast head+tail hash check that runs before merging extensions, catching on-disk corruption without the cost of a full SHA256. The spot hash covers file_size + first N bytes + last N bytes (configurable via spot_check_bytes in avocadoctl.conf, default 4096). Spot hashes are computed and cached in spot_hashes.json alongside the manifest during staging, then verified at merge time.
Move the spot-check verification to run before switching the active symlink and before unmerging extensions. This prevents tearing down a working system (including sshd) only to discover the target runtime's images are corrupt. Also fall back to full SHA256 validation when no spot_hashes.json exists, then generate and save the spot cache so future checks are fast. This covers runtimes provisioned before the spot-check feature.
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.
Summary
spot_check_bytesinavocadoctl.conf(default 4096)Test plan
cargo fmt -- --checkpassescargo clippy --all-targets --all-features -- -D warningspasses