github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/netbsd/fs.txt (about) 1 # Copyright 2017 syzkaller project authors. All rights reserved. 2 # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 include <sys/types.h> 5 include <sys/fstypes.h> 6 include <sys/mount.h> 7 include <sys/statvfs.h> 8 include <sys/param.h> 9 include <sys/stat.h> 10 include <sys/ucred.h> 11 include <fcntl.h> 12 include <unistd.h> 13 14 resource fd[int32]: 0xffffffffffffffff, AT_FDCWD 15 resource fd_dir[fd] 16 17 resource pid[int32]: 0, 0xffffffffffffffff 18 resource uid[int32]: 0, 0xffffffffffffffff 19 resource gid[int32]: 0, 0xffffffffffffffff 20 21 resource dev[int64]: 0, 0xffffffffffffffff 22 23 type mode int32 24 type ino int64 25 type nlink int32 26 27 compat_43_ocreat(path ptr[in, filename], mode flags[open_mode]) 28 open(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd 29 # Just so that we have something that creates fd_dir resources. 30 open$dir(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir 31 openat(fd fd_dir[opt], file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd 32 close(fd fd) 33 read(fd fd, buf buffer[out], count len[buf]) 34 readv(fd fd, vec ptr[in, array[iovec_out]], vlen len[vec]) 35 pread(fd fd, buf buffer[in], nbyte len[buf], off fileoff) 36 preadv(fd fd, vec ptr[in, array[iovec_out]], vlen len[vec], off fileoff) 37 write(fd fd, buf buffer[in], count len[buf]) 38 writev(fd fd, vec ptr[in, array[iovec_in]], vlen len[vec]) 39 pwrite(fd fd, buf buffer[in], nbyte len[buf], off fileoff) 40 pwritev(fd fd, vec ptr[in, array[iovec_in]], vlen len[vec], off fileoff) 41 lseek(fd fd, pad const[0], offset fileoff, whence flags[seek_whence]) 42 compat_43_olseek(fd fd, offset fileoff[int64], whence flags[seek_whence]) 43 dup(oldfd fd) fd 44 dup2(oldfd fd, newfd fd) fd 45 dup3(oldfd fd, newfd fd, flags flags[dup_flags]) fd 46 pipe2(pipefd ptr[out, pipefd], flags flags[pipe_flags]) 47 48 pathconf(file ptr[in, filename], name flags[conf_value]) 49 fpathconf(fd fd, name flags[conf_value]) 50 51 compat_40_mount(type ptr[in, string[filesystem_types]], path ptr[in, filename], flags flags[mount_flags], data buffer[in]) 52 __mount50(type ptr[in, string[filesystem_types]], path ptr[in, filename], flags flags[mount_flags], data buffer[in], len len[data]) 53 unmount(path ptr[in, filename], flags flags[mount_flags]) 54 55 compat_90_statvfs1(path ptr[in, filename], buf ptr[out, statvfs90], f flags[vfs_flags]) 56 compat_90_fstatvfs1(fd fd, buf ptr[out, statvfs90], f flags[vfs_flags]) 57 58 compat_30_getfh(path ptr[in, filename], fhp ptr[out, compat_30_fhandle]) 59 __getfh30(fname ptr[in, filename], fhp buffer[out], fh_size ptr[in, intptr]) 60 compat_30_fhopen(fhp ptr[in, compat_30_fhandle], f flags[fhopen_flags]) fd 61 __fhopen40(fhp buffer[in], fh_size len[fhp], f flags[fhopen_flags]) fd 62 compat_30_fhstat(fhp ptr[in, compat_30_fhandle], sb ptr[out, stat13]) 63 compat_30___fhstat30(fhp ptr[in, compat_30_fhandle], sb ptr[out, stat30]) 64 __fhstat50(fhp buffer[in], fh_size len[fhp], sb ptr[out, stat]) 65 compat_30_fhstatvfs1(fhp ptr[in, compat_30_fhandle], buf ptr[out, statvfs90], f flags[vfs_flags]) 66 compat_90_fhstatvfs1(fhp buffer[in], fh_size len[fhp], buf ptr[out, statvfs90], f flags[vfs_flags]) 67 __fhstatvfs190(fhp buffer[in], fh_size len[fhp], buf ptr[out, statvfs], f flags[vfs_flags]) 68 compat_90_getvfsstat(buf ptr[out, statvfs90, opt], bufsize len[buf], f flags[vfs_flags]) 69 __getvfsstat90(buf ptr[out, statvfs, opt], bufsize len[buf], flags flags[vfs_flags]) 70 71 compat_20_getfsstat(buf ptr[out, statfs12, opt], size len[buf], f flags[getfsstat_flags]) 72 73 pipefd { 74 rfd fd 75 wfd fd 76 } 77 78 iovec_in { 79 addr buffer[in] 80 len len[addr, intptr] 81 } 82 83 iovec_out { 84 addr buffer[out] 85 len len[addr, intptr] 86 } 87 88 stat { 89 st_dev dev 90 st_mode mode 91 st_ino ino 92 st_nlink nlink 93 st_uid uid 94 st_gid gid 95 st_rdev dev 96 st_atim timespec 97 st_mtim timespec 98 st_ctim timespec 99 st_birthtim timespec 100 st_size intptr 101 st_blocks intptr 102 st_blksize int32 103 st_flags int32 104 st_gen int32 105 st_spare array[int32, 2] 106 } 107 108 stat12 { 109 dev int32 110 ino int32 111 mode int16 112 nlink int16 113 uid uid 114 gid gid 115 rdev int32 116 atim timespec50 117 mtim timespec50 118 ctim timespec50 119 size int32 120 blocks int64 121 blksize int32 122 flags int32 123 gen int32 124 lspare int32 125 qspare array[int64, 2] 126 } 127 128 stat13 { 129 st_dev int32 130 st_ino int32 131 st_mode mode 132 st_nlink nlink 133 st_uid int32 134 st_gid int32 135 st_rdev int32 136 st_atim timespec50 137 st_mtim timespec50 138 st_ctim timespec50 139 st_size intptr 140 st_blocks intptr 141 st_blksize int32 142 st_flags int32 143 st_gen int32 144 st_spare0 int32 145 st_birthtim timespec50 146 } 147 148 stat30 { 149 st_dev int32 150 st_mode mode 151 st_ino intptr 152 st_nlink nlink 153 st_uid int32 154 st_gid int32 155 st_rdev int32 156 st_atim timespec50 157 st_mtim timespec50 158 st_ctim timespec50 159 st_birthtim timespec50 160 st_size intptr 161 st_blocks intptr 162 st_blksize int32 163 st_flags int32 164 st_gen int32 165 st_spare array[int32, 2] 166 } 167 168 stat43 { 169 dev int16 170 ino int32 171 mode int16 172 nlink int16 173 uid int16 174 gid int16 175 rdev int16 176 size int32 177 atim timespec50 178 mtim timespec50 179 ctim timespec50 180 blksize int32 181 blocks int32 182 flags int32 183 gen int32 184 } 185 186 define MFSNAMELEN 16 187 define MNAMELEN 90 188 189 statfs12 { 190 type int16 191 oflags int16 192 bsize intptr 193 iosize intptr 194 blocks intptr 195 bfree intptr 196 bavail intptr 197 files intptr 198 ffree intptr 199 fsid fsid_t 200 owner uid 201 flags flags[mount_flags, intptr] 202 swrites intptr 203 aswrites intptr 204 spare array[intptr, 1] 205 fstype array[int8, MFSNAMELEN] 206 mnton array[int8, MNAMELEN] 207 mntfrom array[int8, MNAMELEN] 208 } 209 210 fsid_t { 211 val array[int32, 2] 212 } 213 214 compat_30_fhandle { 215 fh_fsid fsid_t 216 fh_fid compat_30_fid 217 } 218 219 compat_30_fid { 220 fid_len int16 221 fid_reserved int16 222 fid_data array[int8, 16] 223 } 224 225 statvfs90 { 226 f_flag flags[statvfs_flags, int64] 227 f_bsize intptr 228 f_frsize intptr 229 f_iosize intptr 230 f_blocks intptr 231 f_bfree intptr 232 f_bavail intptr 233 f_bresvd intptr 234 f_files intptr 235 f_ffree intptr 236 f_favail intptr 237 f_fresvd intptr 238 f_syncreads intptr 239 f_syncwrites intptr 240 f_asyncreads intptr 241 f_asyncwrites intptr 242 f_fsidx fsid_t 243 f_fsid intptr 244 f_namemax intptr 245 f_owner int32 246 f_spare array[int32, 4] 247 f_fstypename array[int8, 32] 248 f_mntonname array[int8, 1024] 249 f_mntfromname array[int8, 1024] 250 } 251 252 statvfs { 253 f_flag flags[statvfs_flags, int64] 254 f_bsize intptr 255 f_frsize intptr 256 f_iosize intptr 257 f_blocks intptr 258 f_bfree intptr 259 f_bavail intptr 260 f_bresvd intptr 261 f_files intptr 262 f_ffree intptr 263 f_favail intptr 264 f_fresvd intptr 265 f_syncreads intptr 266 f_syncwrites intptr 267 f_asyncreads intptr 268 f_asyncwrites intptr 269 f_fsidx fsid_t 270 f_fsid intptr 271 f_namemax intptr 272 f_owner int32 273 f_spare array[intptr, 4] 274 f_fstypename array[int8, 32] 275 f_mntonname array[int8, 1024] 276 f_mntfromname array[int8, 1024] 277 f_mntfromlabel array[int8, 1024] 278 } 279 280 filesystem_types = "ffs", "nfs", "mfs", "msdos", "lfs", "fdesc", "null", "overlay", "umap", "kernfs", "procfs", "afs", "cd9660", "union", "adosfs", "ext2fs", "coda", "filecore", "ntfs", "smbfs", "ptyfs", "tmpfs", "udf", "sysvbfs", "puffs", "hfs", "efs", "zfs", "nilfs", "rumpfs", "v7fs", "autofs" 281 open_flags = O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_TRUNC, O_EXCL, O_SHLOCK, O_EXLOCK, O_NOFOLLOW, O_CLOEXEC, O_NOSIGPIPE, O_DSYNC, O_SYNC, O_RSYNC, O_ALT_IO, O_NOCTTY, O_DIRECT, O_DIRECTORY, O_ASYNC 282 open_mode = S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR, S_IRWXG, S_IRGRP, S_IWGRP, S_IXGRP, S_IRWXO, S_IROTH, S_IWOTH, S_IXOTH, S_ISUID, S_ISGID, S_ISVTX 283 seek_whence = SEEK_SET, SEEK_CUR, SEEK_END 284 pipe_flags = O_NONBLOCK, O_CLOEXEC, O_NOSIGPIPE 285 mount_flags = MNT_RDONLY, MNT_SYNCHRONOUS, MNT_NOEXEC, MNT_NOSUID, MNT_NODEV, MNT_UNION, MNT_ASYNC, MNT_NOCOREDUMP, MNT_RELATIME, MNT_IGNORE, MNT_DISCARD, MNT_EXTATTR, MNT_LOG, MNT_NOATIME, MNT_AUTOMOUNTED, MNT_SYMPERM, MNT_NODEVMTIME, MNT_SOFTDEP, MNT_EXRDONLY, MNT_EXPORTED, MNT_DEFEXPORTED, MNT_EXPORTANON, MNT_EXKERB, MNT_EXNORESPORT, MNT_EXPUBLIC, MNT_LOCAL, MNT_QUOTA, MNT_ROOTFS 286 getfsstat_flags = MNT_NOWAIT, MNT_WAIT, MNT_LAZY 287 conf_value = _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, _PC_SYNC_IO, _PC_FILESIZEBITS, _PC_SYMLINK_MAX, _PC_2_SYMLINKS, _PC_ACL_EXTENDED, _PC_MIN_HOLE_SIZE, _PC_ACL_PATH_MAX, _PC_ACL_NFS4 288 fhopen_flags = O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_TRUNC, O_EXCL, O_SHLOCK, O_EXLOCK, O_NOFOLLOW, O_CLOEXEC, O_NOSIGPIPE, O_DSYNC, O_SYNC, O_RSYNC, O_ALT_IO, O_NOCTTY, O_DIRECT, O_DIRECTORY, O_ASYNC 289 vfs_flags = ST_NOWAIT, ST_WAIT 290 statvfs_flags = ST_RDONLY, ST_NOEXEC, ST_NOSUID, ST_NODEV, ST_UNION, ST_SYNCHRONOUS, ST_ASYNC, ST_NOCOREDUMP, ST_NOATIME, ST_SYMPERM, ST_NODEVMTIME, ST_LOG, ST_LOCAL, ST_QUOTA, ST_ROOTFS, ST_EXRDONLY, ST_EXPORTED, ST_DEFEXPORTED, ST_EXPORTANON, ST_EXKERB, ST_EXNORESPORT, ST_EXPUBLIC