﻿# fs-verity verifies accessed data but still needs a trusted digest

fs-verity can verify large read-only model files on demand. Separate Merkle-tree read validation from authenticating the expected digest and qualifying the model format.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/linux-fsverity-read-validation-trust-boundary/
Language: en

## Fast measurement does not mean a complete eager scan

A model server measures an fs-verity digest before mapping a large weights file and reports that every byte was verified at startup. That interpretation loses the on-demand design: the file digest can be retrieved efficiently while data is verified as it is read.

The [kernel fs-verity reference](https://docs.kernel.org/filesystems/fsverity.html) describes transparent verification against a persisted Merkle tree. Corrupted accessed data fails verification, including mapped reads. Unread regions need not have been eagerly scanned merely because measurement succeeded.

## Establish the enabled read-only file

Record the filesystem's support, the actual file identity and whether verity is enabled. Enabling it builds the Merkle metadata and makes the file read-only. Do not assume that a filename suffix or a neighboring signed manifest proves that the selected file has the property.

Bind the model loader's file selection to this observation. A checked file that is not the file later opened by the loader leaves a policy gap. Preserve supported publication and ownership controls that prevent substitution outside the verified file identity.

## Authenticate the expected digest

By itself, integrity checking against a tree does not establish who supplied the intended contents. The [fsverity-utils documentation](https://raw.githubusercontent.com/ebiggers/fsverity-utils/master/README.md) explicitly requires comparing a measured digest with a trusted value for authenticity when no signature policy supplies that trust.

Define where the expected digest comes from, who can update it and which algorithm and verity parameters its representation covers. A digest stored beside a model under the same untrusted write authority cannot independently authenticate the model.

## Separate signature checking and enforcement

The documentation distinguishes mechanisms for verifying signatures from the policy that requires particular files to be verified. A system that can validate a signature but accepts an unsigned substitute on the same loading path has not enforced the intended model policy.

Review the actual trusted loader or configured kernel enforcement mechanism. Avoid claiming that installing a utility or enabling optional signature support makes every model file mandatory-verifiable automatically. The acceptance boundary is the path used for the real file open and read.

## Exercise the lazy failure path

Use disposable fixtures to confirm that a matching trusted digest is accepted, an unauthorized digest is rejected and corruption produces a handled read failure on accessed data. A mapped-read failure must not be silently converted into a valid partially loaded model.

[Checksum scope](/journal/guide-storage-object-checksum/) explains the difference between a digest and trusted provenance. [Consistent artifact capture](/journal/guide-storage-filesystem-snapshot/) explains why verified individual files still need a coherent model bundle.

## Acceptance for a verified loader

Accept the integration when it requires verity on the intended files, authenticates the expected digest and handles runtime verification failures as load or service errors. Record whether the workflow intentionally performs a full read or relies on on-demand checking. Neither choice certifies model quality, safe deserialization or licensing; it establishes a specific integrity and authenticity boundary for the bytes the application is allowed to consume.
