Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many: snap integrity discovery run mode #15044

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

sespiros
Copy link
Contributor

@sespiros sespiros commented Feb 7, 2025

This is based on top of:

and enables mounting snaps with integrity data in run mode.

Jira: https://warthogs.atlassian.net/browse/FR-10111

c/snap-bootstrap: add separate file for installrun mode (preseed) and further refactors
the new design simplifies how snap dm-verity data for a corresponding
snap are generated and used by having them as a separate file (i.e
located next to the snap file) instead of attaching them at the end of
their snap file by default.

The extra integrity data header is removed as all the information
needed to mount a snap with its verity data (root hash, salt, other
parameters) will be retrieved from a new integrity stanza in
snap-revision assertions.
  - stopped exporting veritySuperBlock.Validate(). Call it as part of
  ReadSuperBlock() instead.
  - rename LookupDmVerityData to LookupDmVerityDataAndCrossCheck.
  - create 2 error types ErrDmVerityDataNotFound and
    ErrUnexpectedDmVerityData. These error types will be useful for
    instance in snap-bootstrap. snap-bootstrap will need to make a
    decision about whether to generate data in case
    ErrDmVerityDataNotFound or wrap the error with extra context such as
    "dm-verity data found on disk don't match assertion" in case
    ErrUnexpectedDmVerityData.
This commit adds support for looking up dm-verity integrity data
for asserted snaps in the seed (ones that have verified assertions
available).

snap-bootstrap can then use these integrity data parameters to call to
the snap integrity API in order to either detect available dm-verity
hash data or generate them. It will then proceed with mounting the
snaps using dm-verity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant