github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/netbsd/sys.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/ioctl.h> 6 include <sys/mman.h> 7 include <sys/stat.h> 8 include <fcntl.h> 9 include <unistd.h> 10 include <sys/time.h> 11 include <dirent.h> 12 include <poll.h> 13 include <sys/select.h> 14 include <sys/param.h> 15 include <sys/resource.h> 16 include <time.h> 17 include <signal.h> 18 include <sys/wait.h> 19 include <sys/ptrace.h> 20 include <sys/sched.h> 21 include <sys/signal.h> 22 include <sys/spawn.h> 23 include <sys/module.h> 24 include <sys/swap.h> 25 include <sys/ras.h> 26 27 syz_execute_func(text ptr[in, text[target]]) (disabled) 28 29 pipe(pipefd ptr[out, pipefd]) 30 31 compat_12_stat12(file ptr[in, filename], ub ptr[out, stat12]) 32 compat_30___stat13(path ptr[in, filename], ub ptr[out, stat13]) 33 compat_50___stat30(path ptr[in, filename], ub ptr[out, stat30]) 34 compat_43_stat43(file ptr[in, filename], ua ptr[out, stat43]) 35 __stat50(file ptr[in, filename], ua ptr[out, stat]) 36 37 compat_12_lstat12(file ptr[in, filename], ub ptr[out, stat12]) 38 compat_30___lstat13(path ptr[in, filename], ub ptr[out, stat13]) 39 compat_50___lstat30(path ptr[in, filename], ub ptr[out, stat30]) 40 compat_43_lstat43(file ptr[in, filename], ua ptr[out, stat43]) 41 __lstat50(file ptr[in, filename], ua ptr[out, stat]) 42 43 compat_12_fstat12(fd fd, sb ptr[out, stat12]) 44 compat_30___fstat13(fd fd, sb ptr[out, stat13]) 45 compat_50___fstat30(fd fd, sb ptr[out, stat30]) 46 compat_43_fstat43(fd fd, sb ptr[out, stat43]) 47 __fstat50(fd fd, sb ptr[out, stat]) 48 49 compat_20_statfs(path ptr[in, filename], buf ptr[out, statfs12]) 50 compat_20_fstatfs(fd fd, buf ptr[out, statfs12]) 51 fstatat(fd fd, path ptr[in, filename], buf ptr[out, stat], flag flags[fstatat_flags]) 52 profil(samples buffer[inout], size len[samples], offt intptr, scale int32) 53 54 compat_43_ogetdirentries(fd fd, buf buffer[out], count int32, basep ptr[in, intptr]) 55 compat_12_getdirentries(fd fd, buf buffer[out], count int32, basep ptr[in, intptr]) 56 57 compat_09_ouname(name ptr[out, outsname]) 58 59 compat_12_msync(addr vma, len int32) 60 __msync13(addr vma, len int32, f flags[msync_flags]) 61 62 poll(fds ptr[in, array[pollfd]], nfds len[fds], timeout int32) 63 compat_50_select(nd len[inp], inp ptr[inout, fd_set], ou ptr[inout, fd_set], ex ptr[inout, fd_set], tv ptr[inout, timeval50]) 64 __select50(n len[inp], inp ptr[inout, fd_set], ou ptr[inout, fd_set], ex ptr[inout, fd_set], tv ptr[inout, timeval]) 65 66 mincore(addr vma, size len[addr], vec buffer[out]) 67 minherit(addr vma, len len[addr], inherit flags[minherit_flags]) 68 69 fcntl$dupfd(fd fd, cmd flags[fcntl_dupfd], arg fd) fd 70 fcntl$getflags(fd fd, cmd flags[fcntl_getflags]) 71 fcntl$setflags(fd fd, cmd const[F_SETFD], flags flags[fcntl_flags]) 72 fcntl$setstatus(fd fd, cmd const[F_SETFL], flags flags[fcntl_status]) 73 fcntl$lock(fd fd, cmd flags[fcntl_lock], lock ptr[in, flock]) 74 fcntl$getown(fd fd, cmd const[F_GETOWN]) pid 75 fcntl$setown(fd fd, cmd const[F_SETOWN], pid pid) 76 77 ioctl$FIOSEEKDATA(fd fd, cmd const[FIOSEEKDATA], arg ptr[inout, fileoff[int64]]) 78 ioctl$FIOSEEKHOLE(fd fd, cmd const[FIOSEEKHOLE], arg ptr[inout, fileoff[int64]]) 79 ioctl$FIONREAD(fd fd, cmd const[FIONREAD], arg ptr[out, int32]) 80 ioctl$FIONBIO(fd fd, cmd const[FIONBIO], arg ptr[in, int32]) 81 ioctl$FIOASYNC(fd fd, cmd const[FIOASYNC], arg ptr[in, int32]) 82 ioctl$FIOSETOWN(fd fd, cmd const[FIOSETOWN], arg ptr[in, int32]) 83 ioctl$FIOGETOWN(fd fd, cmd const[FIOGETOWN], arg ptr[out, int32]) 84 ioctl$OFIOGETBMAP(fd fd, cmd const[OFIOGETBMAP], arg ptr[inout, int32]) 85 ioctl$FIOGETBMAP(fd fd, cmd const[FIOGETBMAP], arg ptr[inout, int64]) 86 ioctl$FIONWRITE(fd fd, cmd const[FIONWRITE], arg ptr[out, int32]) 87 ioctl$FIONSPACE(fd fd, cmd const[FIONSPACE], arg ptr[out, int32]) 88 89 compat_50_mknod(file ptr[in, filename], mode flags[mknod_mode], dev int32) 90 mknod(file ptr[in, filename], mode flags[mknod_mode], dev dev) 91 mknod$loop(file ptr[in, filename], mode flags[mknod_mode], dev proc[1792, 2]) 92 mknodat(dirfd fd_dir, file ptr[in, filename], mode flags[mknod_mode], dev int32) 93 umask(mode flags[open_mode]) 94 chmod(file ptr[in, filename], mode flags[open_mode]) 95 lchmod(file ptr[in, filename], mode flags[open_mode]) 96 fchmod(fd fd, mode flags[open_mode]) 97 fchmodat(dirfd fd_dir, file ptr[in, filename], mode flags[open_mode], flags flags[at_flags]) 98 chown(file ptr[in, filename], uid uid, gid gid) 99 lchown(file ptr[in, filename], uid uid, gid gid) 100 fchown(fd fd, uid uid, gid gid) 101 fchownat(dirfd fd_dir, file ptr[in, filename], uid uid, gid gid, flags flags[at_flags]) 102 __posix_chown(path ptr[in, filename], uid uid, gid gid) 103 __posix_fchown(path ptr[in, filename], uid uid, gid gid) 104 __posix_lchown(fd fd, uid uid, gid gid) 105 __posix_rename(from ptr[in, filename], to ptr[in, filename]) 106 __posix_fadvise50(fd fd, pad const[0], offset intptr, len intptr, advice flags[fadvise_flags]) 107 108 access(pathname ptr[in, filename], mode flags[access_mode]) 109 chflags(file ptr[in, filename], flags flags[chflags_flags]) 110 fchflags(fd fd, flags flags[chflags_flags]) 111 lchflags(file ptr[in, filename], flags flags[chflags_flags]) 112 faccessat(dirfd fd_dir, pathname ptr[in, filename], mode flags[access_mode], flags flags[faccessat_flags]) 113 compat_50_quotactl(path ptr[in, filename], cmd int32, id uid, addr buffer[in]) 114 115 compat_50_utimes(filename ptr[in, filename], times ptr[in, timeval50]) 116 compat_50_futimes(fd fd, times ptr[in, timeval50]) 117 compat_50_lutimes(link ptr[in, filename], times ptr[in, timeval50]) 118 __utimes50(filename ptr[in, filename], times ptr[in, timeval]) 119 __futimes50(fd fd, times ptr[in, timeval]) 120 __lutimes50(link ptr[in, filename], times ptr[in, timeval]) 121 utimensat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval], flags flags[utimensat_flags]) 122 123 undelete(path ptr[in, filename]) 124 125 execve(file ptr[in, filename], argv ptr[in, array[ptr[in, string]]], envp ptr[in, array[ptr[in, string]]]) 126 127 getgid() gid 128 getegid() gid 129 setuid(uid uid) 130 setgid(gid gid) 131 seteuid(euid uid) 132 setegid(egid gid) 133 getuid() uid 134 geteuid() uid 135 setpgid(pid pid, pgid pid) 136 getpgid(pid pid) pid 137 getpgrp() pid 138 getpid() pid 139 getppid() pid 140 setreuid(ruid uid, euid uid) 141 setregid(rgid gid, egid gid) 142 getgroups(size len[list], list ptr[inout, array[gid]]) 143 setgroups(size len[list], list ptr[in, array[gid]]) 144 __getlogin(buf buffer[out], size len[buf]) 145 getsid(pid pid) pid 146 #__setlogin(buf buffer[in]) #Unsure about effects on test process 147 #setsid() pid #Unsure about effects on test process 148 setpriority(which flags[priority_which], who pid, prio int32) 149 getpriority(which flags[priority_which], who pid) 150 151 compat_43_ogethostid() 152 compat_43_osethostid(hostid int32) 153 compat_09_ogetdomainname(domainname buffer[out], len len[domainname]) 154 compat_09_osetdomainname(domainname buffer[in], len len[domainname]) 155 compat_43_ogethostname(hostname buffer[out], len len[hostname]) 156 compat_43_osethostname(hostname buffer[in], len len[hostname]) 157 158 link(old ptr[in, filename], new ptr[in, filename]) 159 linkat(oldfd fd_dir, old ptr[in, filename], newfd fd_dir, new ptr[in, filename], flags flags[linkat_flags]) 160 symlinkat(old ptr[in, filename], newfd fd_dir, new ptr[in, filename]) 161 symlink(old ptr[in, filename], new ptr[in, filename]) 162 unlink(path ptr[in, filename]) 163 unlinkat(fd fd_dir, path ptr[in, filename], flags flags[unlinkat_flags]) 164 readlink(path ptr[in, filename], buf buffer[out], siz len[buf]) 165 readlinkat(fd fd_dir, path ptr[in, filename], buf buffer[out], siz len[buf]) 166 rename(old ptr[in, filename], new ptr[in, filename]) 167 renameat(oldfd fd_dir, old ptr[in, filename], newfd fd_dir, new ptr[in, filename]) 168 mkdir(path ptr[in, filename], mode flags[open_mode]) 169 mkdirat(fd fd_dir, path ptr[in, filename], mode flags[open_mode]) 170 rmdir(path ptr[in, filename]) 171 truncate(file ptr[in, filename], pad const[0], len intptr) 172 compat_43_otruncate(file ptr[in, filename], len intptr) 173 ftruncate(fd fd, pad const[0], len intptr) 174 compat_43_oftruncate(fd fd, len intptr) 175 flock(fd fd, op flags[flock_op]) 176 fsync(fd fd) 177 fdatasync(fd fd) 178 sync() 179 compat_30_getdents(fd fd_dir, ent buffer[out], count int32) 180 __getdents30(fd fd_dir, ent buffer[out], count int32) 181 chroot(dir ptr[in, filename]) 182 __getcwd(buf buffer[out], size len[buf]) 183 fchroot(fd fd) 184 chdir(dir ptr[in, filename]) 185 fchdir(fd fd) 186 acct(filename ptr[in, filename, opt]) 187 188 compat_50_getrusage(who flags[rusage_who], usage ptr[out, rusage50]) 189 __getrusage50(who flags[rusage_who], usage ptr[out, rusage]) 190 getrlimit(res flags[rlimit_type], rlp ptr[out, rlimit]) 191 compat_43_ogetrlimit(res flags[rlimit_type], rlp ptr[out, orlimit]) 192 setrlimit(res flags[rlimit_type], rlp ptr[in, rlimit]) 193 compat_43_osetrlimit(res flags[rlimit_type], rlp ptr[in, orlimit]) 194 195 rasctl(addr buffer[in], len intptr, op flags[rasctl_flags]) 196 197 swapctl$SWAP_NSWAP(cmd const[SWAP_NSWAP]) 198 swapctl$SWAP_STATS(cmd const[SWAP_STATS], arg ptr[out, swapent], misc int32) 199 swapctl$SWAP_ON(cmd const[SWAP_ON], arg buffer[in], misc int32) 200 swapctl$SWAP_OFF(cmd const[SWAP_OFF], arg buffer[in]) 201 swapctl$SWAP_CTL(cmd const[SWAP_CTL], arg buffer[in], misc int32) 202 swapctl$SWAP_DUMPDEV(cmd const[SWAP_DUMPDEV], arg buffer[in], misc int32) 203 swapctl$SWAP_GETDUMPDEV(cmd const[SWAP_GETDUMPDEV], arg dev, misc int32) 204 205 modctl$MODCTL_LOAD(cmd const[MODCTL_LOAD], arg ptr[in, modctl_load]) 206 modctl$MODCTL_UNLOAD(cmd const[MODCTL_UNLOAD], arg buffer[in]) 207 modctl$MODCTL_STAT(cmd const[MODCTL_STAT], arg ptr[out, iovec_out]) 208 modctl$MODCTL_EXISTS(cmd const[MODCTL_EXISTS], arg int32) 209 210 compat_50_clock_gettime(id flags[clock_id], tp ptr[out, timespec50]) 211 compat_50_clock_settime(id flags[clock_id], tp ptr[in, timespec50]) 212 compat_50_clock_getres(id flags[clock_id], res ptr[out, timespec50, opt]) 213 clock_nanosleep(id flags[clock_id], flags flags[timer_flags], rqtp ptr[in, timespec], rmtp ptr[out, timespec, opt]) 214 compat_50_setitimer(which flags[getitimer_which], new ptr[in, itimerval50], old ptr[out, itimerval, opt]) 215 compat_50_getitimer(which flags[getitimer_which], value ptr[out, itimerval50]) 216 compat_50_nanosleep(rqtp ptr[in, timespec50], rmtp ptr[out, timespec50, opt]) 217 __setitimer50(which flags[getitimer_which], new ptr[in, itimerval], old ptr[out, itimerval, opt]) 218 __getitimer50(which flags[getitimer_which], value ptr[out, itimerval]) 219 __clock_gettime50(id flags[clock_id], tp ptr[out, timespec]) 220 __clock_settime50(id flags[clock_id], tp ptr[in, timespec]) 221 __clock_getres50(id flags[clock_id], res ptr[out, timespec, opt]) 222 __nanosleep50(rqtp ptr[in, timespec], rmtp ptr[out, timespec, opt]) 223 compat_50_wait4(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage50, opt]) 224 __wait450(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage, opt]) 225 226 exit(code intptr) 227 ptrace(request intptr, pid pid, addr ptr[out, intptr], data intptr) 228 __clone(flags flags[clone_flags], sp buffer[in]) pid 229 fork() pid 230 __vfork14() pid 231 vfork() pid 232 posix_spawn(pid pid, path ptr[in, string], file_actions ptr[in, posix_spawn_file_actions], attrp ptr[in, posix_spawnattr], argv ptr[in, array[string]], envp ptr[in, array[string]]) pid 233 234 outsname { 235 sname array[int8, 32] 236 nname array[int8, 32] 237 release array[int8, 32] 238 version array[int8, 32] 239 mach array[int8, 32] 240 } 241 242 pollfd { 243 fd fd 244 events flags[pollfd_events, int16] 245 revents const[0, int16] 246 } 247 248 timespec { 249 sec intptr 250 nsec intptr 251 } 252 253 timespec50 { 254 sec int32 255 nsec intptr 256 } 257 258 timeval { 259 sec intptr 260 usec intptr 261 } 262 263 timeval50 { 264 sec intptr 265 usec intptr 266 } 267 268 itimerval { 269 interv timeval 270 value timeval 271 } 272 273 itimerval50 { 274 interv timeval50 275 value timeval50 276 } 277 278 # TODO: fd_set needs to be a separate type 279 fd_set { 280 mask0 int64 281 mask1 int64 282 mask2 int64 283 mask3 int64 284 mask4 int64 285 mask5 int64 286 mask6 int64 287 mask7 int64 288 } 289 290 rusage { 291 utime timeval 292 stime timeval 293 maxrss intptr 294 ixrss intptr 295 idrss intptr 296 isrss intptr 297 minflt intptr 298 majflt intptr 299 nswap intptr 300 inblock intptr 301 oublock intptr 302 msgsnd intptr 303 msgrcv intptr 304 signals intptr 305 nvcsw intptr 306 nivcsw intptr 307 } 308 309 rusage50 { 310 utime timeval50 311 stime timeval50 312 maxrss intptr 313 ixrss intptr 314 idrss intptr 315 isrss intptr 316 minflt intptr 317 majflt intptr 318 nswap intptr 319 inblock intptr 320 oublock intptr 321 msgsnd intptr 322 msgrcv intptr 323 signals intptr 324 nvcsw intptr 325 nivcsw intptr 326 } 327 328 rlimit { 329 soft intptr 330 hard intptr 331 } 332 333 orlimit { 334 cur int32 335 max int32 336 } 337 338 flock { 339 type flags[flock_type, int16] 340 whence flags[seek_whence, int16] 341 start intptr 342 len intptr 343 pid pid 344 } 345 346 linger { 347 onoff int32 348 linger int32 349 } 350 351 ucred { 352 pid pid 353 uid uid 354 gid gid 355 } 356 357 posix_spawn_file_actions { 358 size int32 359 len int32 360 fae ptr[in, posix_spawn_file_actions_entry] 361 } 362 363 posix_spawn_file_actions_entry [ 364 open posix_spawn_file_actions_entry_t[FAE_OPEN, fd, open_t] 365 dup posix_spawn_file_actions_entry_t[FAE_DUP2, fd, dup2_t] 366 close posix_spawn_file_actions_entry_t[FAE_CLOSE, fd, void] 367 ] 368 369 type posix_spawn_file_actions_entry_t[ACTION, FILEDES, DATA] { 370 fae_action const[ACTION, int32] 371 fae_filedes FILEDES 372 fae_data DATA 373 } 374 375 open_t { 376 path ptr[in, string] 377 oflag int32 378 mode int32 379 } 380 381 dup2_t { 382 newfildes int32 383 } 384 385 posix_spawnattr { 386 sa_flags flags[sa_flags, int16] 387 sa_pgroup pid 388 sa_schedparam sched_param 389 sa_schedpolicy int32 390 sa_sigdefault sigset_t 391 sa_sigmask sigset_t 392 } 393 394 sched_param { 395 sched_priority int32 396 } 397 398 swapent { 399 dev intptr 400 flags flags[swapent_flags, int32] 401 nblks int32 402 inuse int32 403 priority int32 404 path buffer[in] 405 } 406 407 modctl_load { 408 fname buffer[in] 409 flags flags[modctl_flags, int32] 410 props buffer[in] 411 propslen len[props, intptr] 412 } 413 414 fstatat_flags = AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW, AT_EACCESS, AT_REMOVEDIR 415 pollfd_events = POLLIN, POLLPRI, POLLOUT, POLLERR, POLLHUP, POLLNVAL, POLLRDNORM, POLLRDBAND, POLLWRNORM, POLLWRBAND 416 mknod_mode = S_IFREG, S_IFCHR, S_IFBLK, S_IFIFO, S_IFSOCK, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH 417 msync_flags = MS_ASYNC, MS_SYNC, MS_INVALIDATE 418 at_flags = AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW 419 access_mode = R_OK, W_OK, X_OK, F_OK 420 priority_which = PRIO_PROCESS, PRIO_PGRP, PRIO_USER 421 linkat_flags = AT_SYMLINK_FOLLOW 422 unlinkat_flags = 0, AT_REMOVEDIR 423 flock_op = LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB 424 faccessat_flags = AT_EACCESS, AT_SYMLINK_NOFOLLOW 425 rusage_who = RUSAGE_SELF, RUSAGE_CHILDREN 426 rlimit_type = RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_MEMLOCK, RLIMIT_NPROC, RLIMIT_NOFILE, RLIMIT_SBSIZE, RLIMIT_AS, RLIMIT_NTHR 427 timer_flags = TIMER_RELTIME, TIMER_ABSTIME 428 clock_id = CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_VIRTUAL, CLOCK_PROF, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID 429 getitimer_which = ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF, ITIMER_MONOTONIC 430 wait_options = WALLSIG, WALTSIG, WCONTINUED, WEXITED, WNOHANG, WNOZOMBIE, WSTOPPED, WTRAPPED, WUNTRACED, __WALL, __WCLONE 431 utimensat_flags = 0, AT_SYMLINK_NOFOLLOW 432 fcntl_dupfd = F_DUPFD, F_DUPFD_CLOEXEC 433 fcntl_getflags = F_GETFD, F_GETFL 434 fcntl_lock = F_SETLK, F_SETLKW, F_GETLK 435 fcntl_flags = FD_CLOEXEC 436 fcntl_status = O_APPEND, O_ASYNC, O_NONBLOCK, O_DSYNC, O_RSYNC, O_ALT_IO, O_DIRECT, O_NOSIGPIPE 437 minherit_flags = MAP_INHERIT_COPY, MAP_INHERIT_NONE, MAP_INHERIT_SHARE, MAP_INHERIT_ZERO 438 flock_type = F_RDLCK, F_WRLCK, F_UNLCK 439 fadvise_flags = POSIX_FADV_NORMAL, POSIX_FADV_RANDOM, POSIX_FADV_SEQUENTIAL, POSIX_FADV_WILLNEED, POSIX_FADV_DONTNEED, POSIX_FADV_NOREUSE 440 chflags_flags = SF_APPEND, SF_IMMUTABLE, SF_ARCHIVED, UF_OPAQUE, UF_APPEND, UF_IMMUTABLE, UF_NODUMP 441 clone_flags = CLONE_CSIGNAL, CLONE_VM, CLONE_FS, CLONE_FILES, CLONE_SIGHAND, CLONE_PTRACE, CLONE_VFORK 442 sa_flags = SA_ONSTACK, SA_RESTART, SA_RESETHAND, SA_NODEFER, SA_NOCLDSTOP, SA_NOCLDWAIT, SA_SIGINFO, SA_NOKERNINFO, SA_ALLBITS 443 dup_flags = O_CLOEXEC, O_NONBLOCK, O_NOSIGPIPE 444 rasctl_flags = RAS_INSTALL, RAS_PURGE, RAS_PURGE_ALL 445 swapent_flags = SWF_INUSE, SWF_ENABLE, SWF_BUSY, SWF_FAKE 446 modctl_flags = MODCTL_NO_PROP, MODCTL_LOAD_FORCE