Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,15 @@ todo = "deny"
needless_borrow = "allow"
needless_borrows_for_generic_args = "allow"


# Temporary: test against the fs-verity helper from
# https://github.com/composefs/composefs-rs/pull/447 (not yet released).
[patch.crates-io]
composefs = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
composefs-boot = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
composefs-ctl = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
composefs-fuse = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
composefs-ioctls = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
composefs-oci = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
composefs-splitdirfdstream = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
composefs-storage = { git = "https://github.com/jeckersb/composefs-rs", rev = "500b287742bce5b3ccbb6e9a7841034c1980e5fb" }
14 changes: 9 additions & 5 deletions crates/ostree-ext/src/fsverity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ fn enable_fsverity_in_objdir(d: &Dir) -> anyhow::Result<()> {
let enabled =
composefs_fsverity::measure_verity_opt::<Sha256HashValue>(f.as_fd())?.is_some();
if !enabled {
// NOTE: We're not using the _with_copy API here because for us it'd require
// copying all the metadata too which is mildly tedious.
// For main composefs we don't need to care about the per-file metadata
// in general which simplifies a lot.
composefs_fsverity::enable_verity_with_retry::<Sha256HashValue>(f.as_fd())?;
// The object already exists, so verity has to go on this inode;
// nothing should still have it open for writing.
match composefs_fsverity::enable_verity_raw::<Sha256HashValue>(f.as_fd()) {
Ok(()) | Err(composefs_fsverity::EnableVerityError::AlreadyEnabled) => {}
Err(e) => {
return Err(e)
.with_context(|| format!("Enabling fs-verity on object {name:?}"));
}
}
}
}
Ok(())
Expand Down
Loading