aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/test
diff options
context:
space:
mode:
authorStefano Duo <stefanoduo@google.com>2020-08-10 11:32:20 +0000
committerDmitry Vyukov <dvyukov@google.com>2020-08-14 18:55:11 +0200
commita1481759c36a84dd1316d40531fc65b3dd6f5b8f (patch)
treec21e539046abe00f7d1ee9a63874c836f8a5cf04 /sys/linux/test
parentaa6107e60d2616837cbf09be1e371132718306dc (diff)
executor/common_linux.h: open target dir inside syz_mount_image()
Refactor syz_mount_image() to support filesystems not requiring a backing device and filesystem image (e.g. FUSE). To do that, we check for the presence of the pointer to the array of struct fs_image_segment: if missingi, there is no need to setup the loop device and we can proceed directly with the mount() syscall. Add syz_mount_image$fuse() (specialization for FUSE) inside sys/linux/fs_fuse.txt.
Diffstat (limited to 'sys/linux/test')
-rw-r--r--sys/linux/test/syz_mount_image_fuse8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/linux/test/syz_mount_image_fuse b/sys/linux/test/syz_mount_image_fuse
new file mode 100644
index 000000000..9b2c0db17
--- /dev/null
+++ b/sys/linux/test/syz_mount_image_fuse
@@ -0,0 +1,8 @@
+r0 = openat$fuse(0xffffffffffffff9c, &AUTO='/dev/fuse\x00', 0x2, 0x0)
+r1 = getuid()
+r2 = getgid()
+r3 = syz_mount_image$fuse(&AUTO='fuse\x00', &AUTO='./file0\x00', 0x0, 0x0, 0x0, 0x0, &AUTO={{'fd', 0x3d, r0}, 0x2c, {'rootmode', 0x3d, 0x4000}, 0x2c, {'user_id', 0x3d, r1}, 0x2c, {'group_id', 0x3d, r2}, 0x2c, {[], [], 0x0}})
+# FUSE_INIT
+syz_fuse_handle_req(r0, &AUTO=""/8192, AUTO, &AUTO={&AUTO={AUTO, 0x0, 0x0, {AUTO, AUTO, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, AUTO, AUTO, [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]}}, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0})
+# FUSE_OPENDIR
+syz_fuse_handle_req(r0, &AUTO=""/8192, AUTO, &AUTO={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, &AUTO={AUTO, 0x0, 0x0, {0x0, 0x0, 0x0}}, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0})