Expand description
Linux fs-verity support for integrity verification.
This module provides complete fs-verity functionality including userspace digest computation, kernel ioctl interfaces for enabling and measuring verity, and hash value types for SHA-256 and SHA-512.
Structs§
- FsVerity
Hasher - Incremental fs-verity digest computation.
- Sha256
Hash Value - A SHA-256 hash value for fs-verity operations.
- Sha512
Hash Value - A SHA-512 hash value for fs-verity operations.
Enums§
- Algorithm
- An fs-verity algorithm identifier.
- Algorithm
Parse Error - Errors from parsing an
Algorithmstring. - Compare
Verity Error - A verity comparison failed.
- Enable
Verity Error - Enabling fsverity failed.
- Measure
Verity Error - Measuring fsverity failed.
Constants§
- DEFAULT_
LG_ BLOCKSIZE - Default log2 block size for fs-verity (4096 bytes).
Traits§
- FsVerity
Hash Value - Trait for fs-verity hash value types supporting SHA-256 and SHA-512.
Functions§
- compute_
verity - Compute the fs-verity digest for a given block of data, in userspace.
- enable_
verity_ maybe_ copy - Enable fs-verity on the given file. If the given file cannot be enabled because it is opened as writable, then a new copy of the file will be returned instead. No attempt is made to sync the copied file contents to disk, it is up to the caller to do so if desired.
- enable_
verity_ raw - Enable fs-verity on the given file.
- enable_
verity_ with_ retry - Enable fs-verity on the given file, retrying if file is opened for writing.
- ensure_
verity_ equal - Compare the fs-verity digest of the file versus the expected digest.
- measure_
verity - Measures fs-verity on the given file.
- measure_
verity_ opt - Measures fs-verity on the given file.
- measure_
verity_ with_ fallback - Try
FS_IOC_MEASURE_VERITY; fall back to in-process Merkle-tree computation when the kernel reports that verity is absent or the filesystem doesn’t support it. This mirrorslcfs_fd_get_fsverity()in the C composefs library.