From a1481759c36a84dd1316d40531fc65b3dd6f5b8f Mon Sep 17 00:00:00 2001 From: Stefano Duo Date: Mon, 10 Aug 2020 11:32:20 +0000 Subject: 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. --- sys/linux/test/syz_mount_image_fuse | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sys/linux/test/syz_mount_image_fuse (limited to 'sys/linux/test') 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}) -- cgit mrf-deployment