Expand description
Audited unsafe syscall wrappers the pure-Rust crates cannot express.
The rest of the workspace is #![forbid(unsafe_code)]. This crate holds the
rustix calls that require unsafe and cannot be reached through a safe
wrapper: the fs-verity ioctls and a read-only memory map. It is
#![deny(unsafe_code)] at the crate root with a scoped
#![allow(unsafe_code)] on each imp/mmap module, so the audited surface
stays confined. Its only dependency is rustix.
The fs-verity entry points target the parameters ostree uses: SHA-256,
4096-byte blocks, and a zero-length salt. read_verity_descriptor
reports the parameters a sealed file carries, so a caller can accept the
kernel’s digest only for a file sealed with those parameters. Mmap backs the static-delta
reader, giving it random access to a decompressed part or source object that
lives in a temp file rather than on the heap.
Re-exports§
pub use imp::VerityDescriptor;pub use imp::enable_verity;pub use imp::measure_verity;pub use imp::read_verity_descriptor;
Structs§
- Mmap
- A read-only, private memory map of an open file.
- Verity
Descriptor - The fields of a file’s
fsverity_descriptorthat name the parameters the file was sealed with.
Functions§
- enable_
verity - Enable fs-verity on
fdwith SHA-256, 4096-byte blocks, and a zero salt. - measure_
verity - Measure the fs-verity SHA-256 digest the kernel holds for
fd. - read_
verity_ descriptor - Read the fs-verity descriptor the kernel holds for
fd.