aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/fs_ioctl_fsverity.txt
blob: c42ec6f1e5b2a77b75e7e94ec54727a0f8c8df74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright 2019 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

# Reference: https://www.kernel.org/doc/html/latest/filesystems/fsverity.html#user-api

include <uapi/linux/fs.h>
include <uapi/linux/fsverity.h>

ioctl$FS_IOC_ENABLE_VERITY(fd fd, cmd const[FS_IOC_ENABLE_VERITY], arg ptr[in, fsverity_enable_arg])
ioctl$FS_IOC_MEASURE_VERITY(fd fd, cmd const[FS_IOC_MEASURE_VERITY], arg ptr[inout, fsverity_digest])
ioctl$FS_IOC_READ_VERITY_METADATA(fd fd, cmd const[FS_IOC_READ_VERITY_METADATA], arg ptr[in, fsverity_read_metadata_arg])

fsverity_hash_alg = FS_VERITY_HASH_ALG_SHA256, FS_VERITY_HASH_ALG_SHA512

fsverity_enable_arg {
	version		const[1, int32]
	hash_algorithm	flags[fsverity_hash_alg, int32]
	block_size	const[4096, int32]
	salt_size	len[salt_ptr, int32]
	salt_ptr	ptr64[in, array[int8]]
	sig_size	len[sig_ptr, int32]
	reserved1	const[0, int32]
	sig_ptr		ptr64[in, array[int8]]
	reserved2	array[const[0, int64], 11]
}

fsverity_digest {
	digest_algorithm	flags[fsverity_hash_alg, int16]
	digest_size		len[digest, int16]
	digest			array[int8]
}

fsverity_metadata_type = FS_VERITY_METADATA_TYPE_MERKLE_TREE, FS_VERITY_METADATA_TYPE_DESCRIPTOR, FS_VERITY_METADATA_TYPE_SIGNATURE

fsverity_read_metadata_arg {
	metadata_type	flags[fsverity_metadata_type, int64]
	offset		int64
	length		len[buf_ptr, int64]
	buf_ptr		ptr64[out, array[int8]]
	reserved	const[0, int64]
}