diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-12-09 13:12:18 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-12-10 10:53:37 +0100 |
| commit | b8887772def52ce680c931092cd0888fca8a548d (patch) | |
| tree | d9bfb24f89bad53c1ba4dd2ade401193d8413060 | |
| parent | 65bf6714291e01565be9116eea2e7b54fb7c51b7 (diff) | |
sys/linux: add incremental-fs
| -rw-r--r-- | sys/linux/filesystem.txt | 2 | ||||
| -rw-r--r-- | sys/linux/fs_incfs.txt | 120 | ||||
| -rw-r--r-- | sys/linux/fs_incfs.txt.const | 19 | ||||
| -rw-r--r-- | sys/linux/xattr.txt | 2 | ||||
| -rw-r--r-- | sys/syz-extract/extract.go | 3 |
5 files changed, 144 insertions, 2 deletions
diff --git a/sys/linux/filesystem.txt b/sys/linux/filesystem.txt index 3ab14f9d3..e195ea4e1 100644 --- a/sys/linux/filesystem.txt +++ b/sys/linux/filesystem.txt @@ -36,7 +36,7 @@ fsmount_attr_flags = MOUNT_ATTR_RDONLY, MOUNT_ATTR_NOSUID, MOUNT_ATTR_NODEV, MOU move_mount_flags = MOVE_MOUNT_F_SYMLINKS, MOVE_MOUNT_F_AUTOMOUNTS, MOVE_MOUNT_F_EMPTY_PATH, MOVE_MOUNT_T_SYMLINKS, MOVE_MOUNT_T_AUTOMOUNTS, MOVE_MOUNT_T_EMPTY_PATH fsconfig_flag_params = "dirsync", "lazytime", "mand", "posixacl", "ro", "sync", "async", "nolazytime", "nomand", "rw", "silent" -filesystem = "sysfs", "rootfs", "ramfs", "tmpfs", "devtmpfs", "debugfs", "securityfs", "sockfs", "pipefs", "anon_inodefs", "devpts", "ext3", "ext2", "ext4", "hugetlbfs", "vfat", "ecryptfs", "fuseblk", "fuse", "rpc_pipefs", "nfs", "nfs4", "nfsd", "binfmt_misc", "autofs", "xfs", "jfs", "msdos", "ntfs", "minix", "hfs", "hfsplus", "qnx4", "ufs", "btrfs", "configfs", "ncpfs", "qnx6", "exofs", "befs", "vxfs", "gfs2", "gfs2meta", "fusectl", "bfs", "nsfs", "efs", "cifs", "efivarfs", "affs", "tracefs", "bdev", "ocfs2", "ocfs2_dlmfs", "hpfs", "proc", "afs", "reiserfs", "jffs2", "romfs", "aio", "sysv", "v7", "udf", "ceph", "pstore", "adfs", "9p", "hostfs", "squashfs", "cramfs", "iso9660", "coda", "nilfs2", "logfs", "overlay", "f2fs", "omfs", "ubifs", "openpromfs", "bpf", "cgroup", "cgroup2", "cpuset", "mqueue", "aufs", "selinuxfs", "dax", "erofs", "virtiofs", "exfat", "binder", "zonefs", "pvfs2" +filesystem = "sysfs", "rootfs", "ramfs", "tmpfs", "devtmpfs", "debugfs", "securityfs", "sockfs", "pipefs", "anon_inodefs", "devpts", "ext3", "ext2", "ext4", "hugetlbfs", "vfat", "ecryptfs", "fuseblk", "fuse", "rpc_pipefs", "nfs", "nfs4", "nfsd", "binfmt_misc", "autofs", "xfs", "jfs", "msdos", "ntfs", "minix", "hfs", "hfsplus", "qnx4", "ufs", "btrfs", "configfs", "ncpfs", "qnx6", "exofs", "befs", "vxfs", "gfs2", "gfs2meta", "fusectl", "bfs", "nsfs", "efs", "cifs", "efivarfs", "affs", "tracefs", "bdev", "ocfs2", "ocfs2_dlmfs", "hpfs", "proc", "afs", "reiserfs", "jffs2", "romfs", "aio", "sysv", "v7", "udf", "ceph", "pstore", "adfs", "9p", "hostfs", "squashfs", "cramfs", "iso9660", "coda", "nilfs2", "logfs", "overlay", "f2fs", "omfs", "ubifs", "openpromfs", "bpf", "cgroup", "cgroup2", "cpuset", "mqueue", "aufs", "selinuxfs", "dax", "erofs", "virtiofs", "exfat", "binder", "zonefs", "pvfs2", "incremental-fs" blockdev_filename [ filename filename diff --git a/sys/linux/fs_incfs.txt b/sys/linux/fs_incfs.txt new file mode 100644 index 000000000..b03ea0dd1 --- /dev/null +++ b/sys/linux/fs_incfs.txt @@ -0,0 +1,120 @@ +# Copyright 2020 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. + +include <asm/ioctls.h> +include <linux/stat.h> +include <uapi/linux/fcntl.h> +include <uapi/linux/incrementalfs.h> + +# incremental-fs is ChromeOS/Android-specific: +# https://chromium.googlesource.com/chromiumos/third_party/kernel/+/2db8add7871ad%5E%21/ + +mount$incfs(src ptr[in, filename], dst ptr[in, filename], type ptr[in, string["incremental-fs"]], flags flags[mount_flags], opts ptr[in, fs_options[incfs_options]]) + +incfs_options [ + read_timeout_ms fs_opt_dec["read_timeout_ms", int32] + readahead fs_opt_dec["readahead", int32] + no_bf_cache fs_opt_dec["no_bf_cache", bool32] + no_bf_readahead fs_opt_dec["no_bf_readahead", bool32] + rlog_pages fs_opt_dec["rlog_pages", int32] + rlog_wakeup_cnt fs_opt_dec["rlog_wakeup_cnt", int32] +] [varlen] + +ioctl$INCFS_IOC_CREATE_FILE(fd fd, cmd const[INCFS_IOC_CREATE_FILE], arg ptr[in, incfs_new_file_args]) +ioctl$INCFS_IOC_FILL_BLOCKS(fd fd, cmd const[INCFS_IOC_FILL_BLOCKS], arg ptr[in, incfs_fill_blocks]) +ioctl$INCFS_IOC_PERMIT_FILL(fd fd, cmd const[INCFS_IOC_PERMIT_FILL], arg ptr[in, incfs_permit_fill]) +ioctl$INCFS_IOC_READ_FILE_SIGNATURE(fd fd, cmd const[INCFS_IOC_READ_FILE_SIGNATURE], arg ptr[in, incfs_get_file_sig_args]) +ioctl$INCFS_IOC_GET_FILLED_BLOCKS(fd fd, cmd const[INCFS_IOC_GET_FILLED_BLOCKS], arg ptr[in, incfs_get_filled_blocks_args]) + +openat$incfs(fd fd_dir, file ptr[in, string[incfs_filename]], flags flags[open_flags], mode flags[open_mode]) fd + +incfs_filename = ".pending_reads", ".log" + +setxattr$incfs_id(path ptr[in, filename], name ptr[in, string["user.incfs.id"]], val ptr[in, incfs_uuid_str], size bytesize[val], flags flags[setxattr_flags]) +setxattr$incfs_size(path ptr[in, filename], name ptr[in, string["user.incfs.size"]], val ptr[in, int64], size bytesize[val], flags flags[setxattr_flags]) +setxattr$incfs_metadata(path ptr[in, filename], name ptr[in, string["user.incfs.metadata"]], val ptr[in, array[int8]], size bytesize[val], flags flags[setxattr_flags]) + +incfs_uuid_t { + zeros array[const[0, int8], 15] + id int8[0:3] +} [align[8]] + +incfs_uuid_str { + zeros array[const['0', int8], 31] + id int8['0':'3'] +} + +incfs_new_file_args { + file_id incfs_uuid_t + size align64[int64] + mode flags[open_mode, int16] + reserved1 const[0, int16] + reserved2 const[0, int32] + directory_path ptr[in, filename] + file_name ptr[in, filename] + file_attr ptr64[in, array[int8, 0:INCFS_MAX_FILE_ATTR_SIZE]] + file_attr_len bytesize[file_attr, int32] + reserved4 const[0, int32] + signature_info ptr64[in, incfs_signature_info] + signature_size bytesize[signature_info, int64] + reserved6 const[0, int16] +} + +incfs_signature_info { + version const[INCFS_SIGNATURE_VERSION, int32] + hash_info_size bytesize[hash_info, int32] + hash_info incfs_hash_info_section + signing_info_size bytesize[signing_info, int32] + signing_info array[int8] +} [packed] + +incfs_hash_info_section { + hash_algorithm flags[incfs_hash_tree_algorithm, int32] + log2_blocksize const[12, int8] + salt_size bytesize[salt, int32] + salt array[int8] + hash_size bytesize[root_hash, int32] + root_hash array[int8] +} [packed] + +incfs_hash_tree_algorithm = INCFS_HASH_TREE_NONE, INCFS_HASH_TREE_SHA256 + +incfs_fill_blocks { + count len[fill_blocks, int64] + fill_blocks ptr64[in, array[incfs_fill_block]] +} + +incfs_fill_block { + block_index int32 + data_len bytesize[data, int32] + data ptr64[in, array[int8]] + compression flags[incfs_compression_alg, int8] + flags flags[incfs_block_flags, int8] + reserved1 const[0, int16] + reserved2 const[0, int32] + reserved3 const[0, int64] +} + +incfs_compression_alg = COMPRESSION_NONE, COMPRESSION_LZ4 +incfs_block_flags = INCFS_BLOCK_FLAGS_NONE, INCFS_BLOCK_FLAGS_HASH + +incfs_permit_fill { + incfs_permit_fill fd +} + +incfs_get_file_sig_args { + file_signature ptr64[out, array[int8]] + file_signature_buf_size bytesize[file_signature, int32] + file_signature_len_out const[0, int32] +} + +incfs_get_filled_blocks_args { + range_buffer ptr64[out, array[int8]] + range_buffer_size bytesize[range_buffer, int32] + start_index int32 + end_index int32 + total_blocks_out const[0, int32] + data_blocks_out const[0, int32] + range_buffer_size_out const[0, int32] + index_out const[0, int32] +} diff --git a/sys/linux/fs_incfs.txt.const b/sys/linux/fs_incfs.txt.const new file mode 100644 index 000000000..f9e350059 --- /dev/null +++ b/sys/linux/fs_incfs.txt.const @@ -0,0 +1,19 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = amd64 +COMPRESSION_LZ4 = amd64:1 +COMPRESSION_NONE = amd64:0 +INCFS_BLOCK_FLAGS_HASH = amd64:1 +INCFS_BLOCK_FLAGS_NONE = amd64:0 +INCFS_HASH_TREE_NONE = amd64:0 +INCFS_HASH_TREE_SHA256 = amd64:1 +INCFS_IOC_CREATE_FILE = amd64:3227019038 +INCFS_IOC_FILL_BLOCKS = amd64:2148558624 +INCFS_IOC_GET_FILLED_BLOCKS = amd64:2150131490 +INCFS_IOC_PERMIT_FILL = amd64:1074030369 +INCFS_IOC_READ_FILE_SIGNATURE = amd64:2148558623 +INCFS_MAX_FILE_ATTR_SIZE = amd64:512 +INCFS_SIGNATURE_VERSION = amd64:2 +__NR_ioctl = amd64:16 +__NR_mount = amd64:165 +__NR_openat = amd64:257 +__NR_setxattr = amd64:188 diff --git a/sys/linux/xattr.txt b/sys/linux/xattr.txt index 1a014e9e9..069f53b95 100644 --- a/sys/linux/xattr.txt +++ b/sys/linux/xattr.txt @@ -37,7 +37,7 @@ setxattr_flags = XATTR_CREATE, XATTR_REPLACE xattr_prefix = "system.", "trusted.", "security.", "user.", "btrfs.", "osx.", "os2." -xattr_names = "system.posix_acl_access", "system.posix_acl_default", "system.advise", "system.sockprotoname", "com.apple.FinderInfo", "com.apple.system.Security", "user.syz", "trusted.syz", "security.apparmor", "trusted.overlay.opaque", "trusted.overlay.redirect", "trusted.overlay.origin", "trusted.overlay.impure", "trusted.overlay.nlink", "trusted.overlay.upper", "trusted.overlay.metacopy" +xattr_names = "system.posix_acl_access", "system.posix_acl_default", "system.advise", "system.sockprotoname", "com.apple.FinderInfo", "com.apple.system.Security", "user.syz", "trusted.syz", "security.apparmor", "trusted.overlay.opaque", "trusted.overlay.redirect", "trusted.overlay.origin", "trusted.overlay.impure", "trusted.overlay.nlink", "trusted.overlay.upper", "trusted.overlay.metacopy", "security.selinux", "user.incfs.id", "user.incfs.size", "user.incfs.metadata" setxattr$system_posix_acl(path ptr[in, filename], name ptr[in, string[xattr_posix_acl_names]], val ptr[in, xattr_system_posix_acl_access], size len[val], flags flags[setxattr_flags]) lsetxattr$system_posix_acl(path ptr[in, filename], name ptr[in, string[xattr_posix_acl_names]], val ptr[in, xattr_system_posix_acl_access], size len[val], flags flags[setxattr_flags]) diff --git a/sys/syz-extract/extract.go b/sys/syz-extract/extract.go index a1ddaa86c..f8a93adcf 100644 --- a/sys/syz-extract/extract.go +++ b/sys/syz-extract/extract.go @@ -275,6 +275,9 @@ func archFileList(os, arch string, files []string) (string, []string, []string, // This was generated on: // https://source.codeaurora.org/quic/la/kernel/msm-4.9 msm-4.9 "dev_video4linux.txt": true, + // This was generated on: + // https://chromium.googlesource.com/chromiumos/third_party/kernel 3a36438201f3 + "fs_incfs.txt": true, } for _, f := range matches { f = filepath.Base(f) |
