From 8d2a4bb0b557746f0843303be71f77e2b8886723 Mon Sep 17 00:00:00 2001 From: liuzerun Date: Wed, 26 Jul 2023 01:34:44 +0000 Subject: [PATCH] add syzkaller test Signed-off-by: liuzerun --- .../qos_auth/hmdfs_comm_device_node.txt | 20 ++++++++++ .../qos_auth/hmdfs_comm_transport.txt | 12 ++++++ test/syzkaller/qos_auth/hmdfs_fill_super.txt | 40 +++++++++++++++++++ .../qos_auth/hmdfs_ioc_set_share_path.txt | 10 +++++ 4 files changed, 82 insertions(+) create mode 100644 test/syzkaller/qos_auth/hmdfs_comm_device_node.txt create mode 100644 test/syzkaller/qos_auth/hmdfs_comm_transport.txt create mode 100644 test/syzkaller/qos_auth/hmdfs_fill_super.txt create mode 100644 test/syzkaller/qos_auth/hmdfs_ioc_set_share_path.txt diff --git a/test/syzkaller/qos_auth/hmdfs_comm_device_node.txt b/test/syzkaller/qos_auth/hmdfs_comm_device_node.txt new file mode 100644 index 0000000..6ec2d22 --- /dev/null +++ b/test/syzkaller/qos_auth/hmdfs_comm_device_node.txt @@ -0,0 +1,20 @@ +include +include +include +include +include + +resource fd_sys_fs_hmdfs_cmd[fd] + +openat$fd_sys_fs_hmdfs_cmd(fd const[AT_FDCWD], file ptr[in, string["/sys/fs/hmdfs/13272509345601772847/cmd"]], flags const[O_RDWR], mode const[0]) fd_sys_fs_hmdfs_cmd + +write$CMD_UPDATE_SOCKET(fd fd_sys_fs_hmdfs_cmd, buf ptr[in, string["0"]], len bytesize[buf]) +lseek$1(fd fd_sys_fs_hmdfs_cmd, offset const[0x0], whence const[0x0]) +write$CMD_UPDATE_DEVSL(fd fd_sys_fs_hmdfs_cmd, buf ptr[in, string["1"]], len bytesize[buf]) +lseek$2(fd fd_sys_fs_hmdfs_cmd, offset const[0x0], whence const[0x0]) +write$CMD_OFF_LINE(fd fd_sys_fs_hmdfs_cmd, buf ptr[in, string["2"]], len bytesize[buf]) +lseek$3(fd fd_sys_fs_hmdfs_cmd, offset const[0x0], whence const[0x0]) +write$CMD_OFF_LINE_ALL(fd fd_sys_fs_hmdfs_cmd, buf ptr[in, string["3"]], len bytesize[buf]) +lseek$4(fd fd_sys_fs_hmdfs_cmd, offset const[0x0], whence const[0x0]) +write$CMD_CNT(fd fd_sys_fs_hmdfs_cmd, buf ptr[in, string["4"]], len bytesize[buf]) +lseek$5(fd fd_sys_fs_hmdfs_cmd, offset const[0x0], whence const[0x0]) \ No newline at end of file diff --git a/test/syzkaller/qos_auth/hmdfs_comm_transport.txt b/test/syzkaller/qos_auth/hmdfs_comm_transport.txt new file mode 100644 index 0000000..8635faf --- /dev/null +++ b/test/syzkaller/qos_auth/hmdfs_comm_transport.txt @@ -0,0 +1,12 @@ +include +include +include +include +include + +resource fd_sys_fs_hmdfs_cmd2[fd] + +openat$fd_sys_fs_hmdfs_cmd2(fd const[AT_FDCWD], file ptr[in, string["/sys/fs/hmdfs/13272509345601772847/cmd"]], flags const[O_RDWR], mode const[0]) fd_sys_fs_hmdfs_cmd2 + +write$CMD_UPDATE_SOCKET_T(fd fd_sys_fs_hmdfs_cmd2, buf ptr[in, string["0"]], len bytesize[buf]) +lseek$10(fd fd_sys_fs_hmdfs_cmd, offset const[0x0], whence const[0x0]) \ No newline at end of file diff --git a/test/syzkaller/qos_auth/hmdfs_fill_super.txt b/test/syzkaller/qos_auth/hmdfs_fill_super.txt new file mode 100644 index 0000000..7e24142 --- /dev/null +++ b/test/syzkaller/qos_auth/hmdfs_fill_super.txt @@ -0,0 +1,40 @@ +include +include +include +include + +mount$hmdfs_fill_super(src const[0], dst ptr[in, filename], type ptr[in, string["hmdfs"]], flags flags[mount_flags]) + +update_socket_param { + cmd int32 + newfd int32 + devsl int32 + status int8 + masterkey array[int8, 32] + cid array[int8, 64] +} + +update_devsl_param { + cmd int32 + newfd int32 + cid array[int8, 64] +} + +offline_param { + cmd int32 + remote_cid array[int8, 64] +} + +offline_all_param { + cmd int32 +} + +hmdfs_opts [ + max_read fs_opt_hex["max_read", int32] + allow_other stringnoz["allow_other"] + default_permissions stringnoz["default_permissions"] + blksize fs_opt_hex["blksize", flags[hmdfs_block_sizes]] +] [varlen] + +hmdfs_mode = S_IFREG, S_IFCHR, S_IFBLK, S_IFIFO, S_IFSOCK, S_IFLNK, S_IFDIR +hmdfs_block_sizes = 512, 1024, 2048, 4096 \ No newline at end of file diff --git a/test/syzkaller/qos_auth/hmdfs_ioc_set_share_path.txt b/test/syzkaller/qos_auth/hmdfs_ioc_set_share_path.txt new file mode 100644 index 0000000..352badd --- /dev/null +++ b/test/syzkaller/qos_auth/hmdfs_ioc_set_share_path.txt @@ -0,0 +1,10 @@ +include +include +include +include +include + +resource fd_hmdfs_ioc_set_share_path[fd] + +openat$fd_hmdfs_ioc_set_share_path(fd const[AT_FDCWD], file ptr[in, string["/mnt/hmdfs/100/account/device_view/local/"]], flags const[O_RDWR], mode const[0]) fd_hmdfs_ioc_set_share_path +ioctl$HMDFS_IOC_SET_SHARE_PATH(fd fd_hmdfs_ioc_set_share_path, cmd const[HMDFS_IOC_SET_SHARE_PATH], arg ptr[in, fd_hmdfs_ioc_set_share_path]) \ No newline at end of file -- Gitee