fs-verity
fs-verity is a Linux filesystem facility that verifies the immutable contents of selected files against a cryptographic file digest.
The digest covers a descriptor containing the Merkle root, file size and hashing parameters. Authenticating it requires a separate trust policy. [1]
FS_IOC_MEASURE_VERITY retrieves the enforced digest without scanning file data; its success does not establish that every block is currently readable. [3] The fsverity digest command instead computes a digest from bytes using selected parameters. Matching it to measure requires the same algorithm, block size and salt; computing it does not enable verification. [4]
Data is checked before becoming readable through the page cache, including mapped access. Already-verified cached data may be reused, and verified hash blocks shorten traversal. A complete logical read need not be a fresh physical-media scan. [5]
A native fsverity-utils v1.6 experiment reproduces equal roots for zero-extended files, a top hash block reused as file contents, and salts 00 versus 0000. The complete descriptor digests differ in all tested pairs. These are construction ambiguities resolved by the descriptor, not hash collisions or fs-verity vulnerabilities. [6] [7]
For empty input, the root is all zeroes but the file digest still hashes the descriptor. The four empty-file observations export no tree bytes; within each algorithm their digest changes with the selected block size. This is not the ordinary hash of empty input. [6] [7]
Relations
- related
- fscrypt, Merkle tree, dm-verity, dm-integrity, Page cache, Rollback protection
Limitations
- Names, ownership and mode are outside its measurement; requiring signatures for verity files does not require every file to use verity. [1]
- Exporting verity metadata does not guarantee its authentication against the measured digest. Linux v6.12 falls back to buffered I/O for verity files rather than providing a direct-I/O verification bypass. [1]
Citations
- Linux v6.12 documentation: fs-verity, descriptor, metadata exclusions and built-in signature limits
- Linux v6.12 measure.c: FS_IOC_MEASURE_VERITY copies the enforced digest
- fsverity-utils v1.6 manual: measure, digest, enable and dump_metadata contracts
- Linux v6.12 verify.c: verification of data and cached hash blocks
- Hesela: 40 native fs-verity descriptor observations and reproduction bundle
- fsverity-utils v1.6: root computation, salt padding and descriptor hashing