path: root/Documentation/filesystems
diff options
authorEric Biggers <>2021-01-15 10:18:17 -0800
committerEric Biggers <>2021-02-07 14:51:14 -0800
commit622699cfe6ec5578f52727002d5717ff3f092e23 (patch)
tree70afcd4d36b8ca0d535043f3e64ec23000bc6bff /Documentation/filesystems
parente17fe6579de023725ec22a16965e9099e4a05ac9 (diff)
fs-verity: support reading Merkle tree with ioctl
Add support for FS_VERITY_METADATA_TYPE_MERKLE_TREE to FS_IOC_READ_VERITY_METADATA. This allows a userspace server program to retrieve the Merkle tree of a verity file for serving to a client which implements fs-verity compatible verification. See the patch which introduced FS_IOC_READ_VERITY_METADATA for more details. This has been tested using a new xfstest which calls this ioctl via a new subcommand for the 'fsverity' program from fsverity-utils. Link: Reviewed-by: Victor Hsieh <> Reviewed-by: Jaegeuk Kim <> Reviewed-by: Chao Yu <> Signed-off-by: Eric Biggers <>
Diffstat (limited to 'Documentation/filesystems')
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/filesystems/fsverity.rst b/Documentation/filesystems/fsverity.rst
index 9ef7a7de6008..50b47a6d9ea1 100644
--- a/Documentation/filesystems/fsverity.rst
+++ b/Documentation/filesystems/fsverity.rst
@@ -234,6 +234,8 @@ need this ioctl.
This ioctl takes in a pointer to the following structure::
struct fsverity_read_metadata_arg {
__u64 metadata_type;
__u64 offset;
@@ -242,7 +244,13 @@ This ioctl takes in a pointer to the following structure::
__u64 __reserved;
-``metadata_type`` specifies the type of metadata to read.
+``metadata_type`` specifies the type of metadata to read:
+- ``FS_VERITY_METADATA_TYPE_MERKLE_TREE`` reads the blocks of the
+ Merkle tree. The blocks are returned in order from the root level
+ to the leaf level. Within each level, the blocks are returned in
+ the same order that their hashes are themselves hashed.
+ See `Merkle tree`_ for more information.
The semantics are similar to those of ``pread()``. ``offset``
specifies the offset in bytes into the metadata item to read from, and