Skip to content

Commit 00574d5

Browse files
jmarrerocgwalters
authored andcommitted
initramfs: Mount composefs candidates by digest with an explicit policy
composefs-rs now provides Repository::mount_digest, which takes the expected digest as a typed value, only looks at images/<digest> and requires the measured fs-verity digest to match before mounting. That is the check the previous commit open-coded around open_image; use the library API instead so there is one implementation of it, shared with composefs-setup-root. composefs-rs also records whether a repository's fs-verity requirement was detected from meta.json or chosen by the caller, and an explicit choice is final for the handle. The initramfs sets `IntegrityPolicy::Explicit(Enabled)` for a strict `composefs=` digest and `Explicit(Disabled)` for one with the `?` marker, then mounts by digest either way. With the marker a missing fs-verity digest is tolerated, but one that can be measured still has to match. The name-based mount() no longer runs in the initramfs, so images/refs/ is never consulted for a boot, with or without the marker. An image that only exists under images/refs/<digest> is now reported as not found rather than as a digest mismatch, so the boot moves on to the next command line candidate the same way it does for a missing image. `Repository::set_insecure` now returns a `Result`, so the remaining callers propagate it. They all run on a freshly opened repository, where the detected policy may still be replaced, so their behavior is unchanged. The booted verity test lists each case's expected result in a table per mode, matches on the typed CompareVerityError::DigestMismatch rather than on the message, and gains a case where images/<digest> is repointed at another verified image, which both modes must reject as a digest mismatch. Bump composefs-ctl to 0.10.0, the release that carries these APIs (composefs/composefs-rs#439). Generated-by: AI Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
1 parent 2c6e47a commit 00574d5

8 files changed

Lines changed: 261 additions & 186 deletions

File tree

‎Cargo.lock‎

Lines changed: 57 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ clap_mangen = { version = "0.3.0" }
4343
# pulls), which drags in rustls-webpki/untrusted/webpki-root-certs whose
4444
# licenses aren't in our cargo-deny allow list. Re-enable once that's sorted.
4545
# See: https://github.com/bootc-dev/bootc/pull/2295
46-
composefs-ctl = { version = "0.9.4", default-features = false, features = [
46+
composefs-ctl = { version = "0.10.0", default-features = false, features = [
4747
"pre-6.15",
4848
"pre-6.16",
4949
"oci",

0 commit comments

Comments
 (0)