github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/fs_ioctl_fsverity.txt (about)

     1  # Copyright 2019 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  # Reference: https://www.kernel.org/doc/html/latest/filesystems/fsverity.html#user-api
     5  
     6  include <uapi/linux/fs.h>
     7  include <uapi/linux/fsverity.h>
     8  
     9  ioctl$FS_IOC_ENABLE_VERITY(fd fd, cmd const[FS_IOC_ENABLE_VERITY], arg ptr[in, fsverity_enable_arg])
    10  ioctl$FS_IOC_MEASURE_VERITY(fd fd, cmd const[FS_IOC_MEASURE_VERITY], arg ptr[inout, fsverity_digest])
    11  ioctl$FS_IOC_READ_VERITY_METADATA(fd fd, cmd const[FS_IOC_READ_VERITY_METADATA], arg ptr[in, fsverity_read_metadata_arg])
    12  
    13  fsverity_hash_alg = FS_VERITY_HASH_ALG_SHA256, FS_VERITY_HASH_ALG_SHA512
    14  
    15  fsverity_enable_arg {
    16  	version		const[1, int32]
    17  	hash_algorithm	flags[fsverity_hash_alg, int32]
    18  	block_size	const[4096, int32]
    19  	salt_size	len[salt_ptr, int32]
    20  	salt_ptr	ptr64[in, array[int8]]
    21  	sig_size	len[sig_ptr, int32]
    22  	reserved1	const[0, int32]
    23  	sig_ptr		ptr64[in, array[int8]]
    24  	reserved2	array[const[0, int64], 11]
    25  }
    26  
    27  fsverity_digest {
    28  	digest_algorithm	flags[fsverity_hash_alg, int16]
    29  	digest_size		len[digest, int16]
    30  	digest			array[int8]
    31  }
    32  
    33  fsverity_metadata_type = FS_VERITY_METADATA_TYPE_MERKLE_TREE, FS_VERITY_METADATA_TYPE_DESCRIPTOR, FS_VERITY_METADATA_TYPE_SIGNATURE
    34  
    35  fsverity_read_metadata_arg {
    36  	metadata_type	flags[fsverity_metadata_type, int64]
    37  	offset		int64
    38  	length		len[buf_ptr, int64]
    39  	buf_ptr		ptr64[out, array[int8]]
    40  	reserved	const[0, int64]
    41  }