Skip to content

composefs-info measure-file reports a wrong fs-verity digest for empty files #442

Closed

Description

@mike-sul

lcfs_fsverity_context_get_digest() computes a digest for zero-length input that disagrees with the kernel and with fsverity-utils and composefs-rs (composefs-rs's drop-in reimplementation of this very command).

Reproduction

$ truncate -s 0 empty

$ fsverity digest empty
sha256:3d248ca542a24fc62d1c43b916eae5016878e2533c88238480b26128a1f1af95 empty

$ cfsctl composefs-info measure-file empty   # composefs-rs reimplementation
3d248ca542a24fc62d1c43b916eae5016878e2533c88238480b26128a1f1af95

$ composefs-info measure-file empty          # this repo
cfc3391077edfd51859f6e5e16e03f82b1da3ee1a35d418b0d0b3b57740b4405

Impact

Narrow in practice: composefs images don't reference empty backing objects, so image digests are unaffected. But composefs-info measure-file is useful as a conformance test for independent implementations, and there
it reports a digest the kernel can never produce; the same applies to any direct consumer of the lcfs_fsverity_context_* API with zero-length input.

Activity

  1. self-assigned this
    on Jul 28, 2026
  2. added a commit that references this issue on Jul 28, 2026
    a66faad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions