From 4f4577d444fa1e3b3823ec3bb785c2d6ee1dd331 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 26 Nov 2022 11:15:27 +0100 Subject: sys/linux: fix afs mounting afs is not image-based filesystems. It accepts some server/cell as source argument. --- sys/linux/filesystem.txt | 23 +++++++++++++++++++++-- sys/linux/test/syz_mount_image_afs_0 | 6 ------ 2 files changed, 21 insertions(+), 8 deletions(-) delete mode 100644 sys/linux/test/syz_mount_image_afs_0 (limited to 'sys/linux') diff --git a/sys/linux/filesystem.txt b/sys/linux/filesystem.txt index d62c9c4bd..d588b887f 100644 --- a/sys/linux/filesystem.txt +++ b/sys/linux/filesystem.txt @@ -14,6 +14,7 @@ mount$binder(src const[0], dst ptr[in, filename], type ptr[in, string["binder"]] mount$tmpfs(src const[0], dst ptr[in, filename], type ptr[in, string["tmpfs"]], flags flags[mount_flags], opts ptr[in, fs_options[tmpfs_options]]) mount$cgroup(src const[0], dst ptr[in, filename], type ptr[in, string["cgroup"]], flags flags[mount_flags], opts ptr[in, fs_options[cgroup_options]]) mount$cgroup2(src const[0], dst ptr[in, filename], type ptr[in, string["cgroup2"]], flags flags[mount_flags], opts ptr[in, fs_options[cgroup2_options]]) +mount$afs(src ptr[in, afs_source], dst ptr[in, filename], type ptr[in, string["afs"]], flags flags[mount_flags], opts ptr[in, fs_options[afs_options]]) # A bind mount ignores the filesystem type argument, but # pkg/host/syscalls_linux.go:isSupportedFilesystem() requires one in @@ -121,7 +122,6 @@ syz_mount_image$nfs(fs ptr[in, string["nfs"]], dir ptr[in, filename], flags flag syz_mount_image$nfs4(fs ptr[in, string["nfs4"]], dir ptr[in, filename], flags flags[mount_flags], opts ptr[in, fs_options[stringnoz]], chdir bool8, size len[img], img ptr[in, compressed_image]) fd_dir (timeout[SYZ_MOUNT_IMAGE_TIMEOUT], no_generate, no_minimize) syz_mount_image$erofs(fs ptr[in, string["erofs"]], dir ptr[in, filename], flags flags[mount_flags], opts ptr[in, fs_options[erofs_options]], chdir bool8, size len[img], img ptr[in, compressed_image]) fd_dir (timeout[SYZ_MOUNT_IMAGE_TIMEOUT], no_generate, no_minimize) syz_mount_image$exfat(fs ptr[in, string["exfat"]], dir ptr[in, filename], flags flags[mount_flags], opts ptr[in, fs_options[exfat_options]], chdir bool8, size len[img], img ptr[in, compressed_image]) fd_dir (timeout[SYZ_MOUNT_IMAGE_TIMEOUT], no_generate, no_minimize) -syz_mount_image$afs(fs ptr[in, string["afs"]], dir ptr[in, filename], flags flags[mount_flags], opts ptr[in, fs_options[afs_options]], chdir bool8, size len[img], img ptr[in, compressed_image]) fd_dir (timeout[SYZ_MOUNT_IMAGE_TIMEOUT], no_generate, no_minimize) syz_mount_image$cramfs(fs ptr[in, string["cramfs"]], dir ptr[in, filename], flags flags[mount_flags], opts ptr[in, fs_options[stringnoz]], chdir bool8, size len[img], img ptr[in, compressed_image]) fd_dir (timeout[SYZ_MOUNT_IMAGE_TIMEOUT], no_generate, no_minimize) syz_mount_image$romfs(fs ptr[in, string["romfs"]], dir ptr[in, filename], flags flags[mount_flags], opts ptr[in, fs_options[stringnoz]], chdir bool8, size len[img], img ptr[in, compressed_image]) fd_dir (timeout[SYZ_MOUNT_IMAGE_TIMEOUT], no_generate, no_minimize) syz_mount_image$efs(fs ptr[in, string["efs"]], dir ptr[in, filename], flags flags[mount_flags], opts ptr[in, fs_options[stringnoz]], chdir bool8, size len[img], img ptr[in, compressed_image]) fd_dir (timeout[SYZ_MOUNT_IMAGE_TIMEOUT], no_generate, no_minimize) @@ -807,6 +807,26 @@ exfat_options [ discard stringnoz["discard"] ] [varlen] +# TODO: afs should be configured via /proc/fs/afs/{cells,servers} (see fs/afs/proc.c). +# Without that mounting of afs will fail. +afs_source [ + none string["none"] + cell afs_cell_source +] [varlen] + +afs_cell_source { + prefix flags[afs_cell_prefix, int8] + cell stringnoz[afs_cells] + volname stringnoz[afs_volnames] + suffix stringnoz[afs_suffixes] + z const[0, int8] +} [packed] + +afs_cell_prefix = '%', '#' +afs_cells = "", "syz0:", "syz1:" +afs_volnames = "syz0", "syz1" +afs_suffixes = "", ".readonly", ".backup" + afs_options [ autocell stringnoz["autocell"] dyn stringnoz["dyn"] @@ -814,7 +834,6 @@ afs_options [ flock_openafs stringnoz["flock=openafs"] flock_strict stringnoz["flock=strict"] flock_write stringnoz["flock=write"] - source fs_opt_str["source"] ] [varlen] tmpfs_options [ diff --git a/sys/linux/test/syz_mount_image_afs_0 b/sys/linux/test/syz_mount_image_afs_0 deleted file mode 100644 index 63289d1da..000000000 --- a/sys/linux/test/syz_mount_image_afs_0 +++ /dev/null @@ -1,6 +0,0 @@ -# Code generated by tools/syz-imagegen. DO NOT EDIT. -# requires: manual - -# #00: mkfs.afs[ 1MB] [fake empty image] - -syz_mount_image$afs(&AUTO='afs\x00', &AUTO='./file0\x00', 0x0, &AUTO, 0x1, AUTO, &AUTO="$eJzswDEBAAAAwiD7pzbEXhgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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