github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/freebsd/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/mman.h> 6 include <sys/proc.h> 7 include <sys/rtprio.h> 8 include <sys/stat.h> 9 include <sys/thr.h> 10 include <fcntl.h> 11 include <unistd.h> 12 include <mqueue.h> 13 include <poll.h> 14 include <sys/socket.h> 15 include <sys/uio.h> 16 include <sys/param.h> 17 include <sys/mount.h> 18 include <sys/resource.h> 19 include <time.h> 20 include <signal.h> 21 include <sys/wait.h> 22 include <sys/time.h> 23 include <sys/specialfd.h> 24 25 type signo int32[0:SIGRTMAX] 26 27 syz_execute_func(text ptr[in, text[target]]) (disabled) 28 29 sf_hdtr { 30 headers ptr[in, array[iovec_in]] 31 hdr_cnt len[headers, int32] 32 trailers ptr[in, array[iovec_in]] 33 trl_cnt len[trailers, int32] 34 } 35 36 resource lwpid[int32]: 0, 0xffffffffffffffff 37 38 sf_flags = SF_NODISKIO, SF_NOCACHE, SF_SYNC, SF_USER_READAHEAD 39 sendfile(fd fd, s sock_in, offset fileoff, nbytes int64, hdtr ptr[in, sf_hdtr], sbytes ptr[out, fileoff[int64]], flags flags[sf_flags]) 40 41 poll(fds ptr[in, array[pollfd]], nfds len[fds], timeout int32) 42 ppoll(fds ptr[in, array[pollfd]], nfds len[fds], tsp ptr[in, timespec], sigmask ptr[in, sigset], size len[sigmask]) 43 select(n len[inp], inp ptr[inout, fd_set], outp ptr[inout, fd_set], exp ptr[inout, fd_set], tvp ptr[inout, timeval]) 44 45 mincore(addr vma, size len[addr], vec buffer[out]) 46 minherit(addr vma, len len[addr], inherit flags[minherit_flags]) 47 48 fcntl$dupfd(fd fd, cmd flags[fcntl_dupfd], arg fd) fd 49 fcntl$getflags(fd fd, cmd flags[fcntl_getflags]) 50 fcntl$setflags(fd fd, cmd const[F_SETFD], flags flags[fcntl_flags]) 51 fcntl$setstatus(fd fd, cmd const[F_SETFL], flags flags[fcntl_status]) 52 fcntl$lock(fd fd, cmd flags[fcntl_lock], lock ptr[in, flock]) 53 fcntl$getown(fd fd, cmd const[F_GETOWN]) pid 54 fcntl$setown(fd fd, cmd const[F_SETOWN], pid pid) 55 56 mknodat(dirfd fd_dir, file ptr[in, filename], mode flags[mknod_mode], dev int64) 57 freebsd11_mknod(file ptr[in, filename], mod flags[mknod_mode], dev int32) 58 freebsd11_mknodat(dirfd fd_dir, file ptr[in, filename], mod flags[mknod_mode], dev int32) 59 chmod(file ptr[in, filename], mode flags[open_mode]) 60 fchmod(fd fd, mode flags[open_mode]) 61 fchmodat(dirfd fd_dir, file ptr[in, filename], mode flags[open_mode], flags flags[at_flags]) 62 lchmod(file ptr[in, filename], mode flags[open_mode]) 63 chown(file ptr[in, filename], uid uid, gid gid) 64 lchown(file ptr[in, filename], uid uid, gid gid) 65 fchown(fd fd, uid uid, gid gid) 66 fchownat(dirfd fd_dir, file ptr[in, filename], uid uid, gid gid, flags flags[at_flags]) 67 chflags(file ptr[in, filename], flags flags[chflags_flags]) 68 chflagsat(fd fd, file ptr[in, filename], flags flags[chflags_flags], atflag flags[at_flags]) 69 fchflags(fd fd, flags flags[chflags_flags]) 70 lchflags(file ptr[in, filename], flags flags[chflags_flags]) 71 faccessat(dirfd fd_dir, pathname ptr[in, filename], mode flags[access_mode], flags flags[faccessat_flags]) 72 access(pathname ptr[in, filename], mode flags[access_mode]) 73 eaccess(pathname ptr[in, filename], mode flags[access_mode]) 74 profil(samples buffer[inout], size len[samples], offt intptr, scale int32) 75 utimes(filename ptr[in, filename], times ptr[in, itimerval]) 76 futimesat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval]) 77 utimensat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval], flags flags[utimensat_flags]) 78 79 execve(file ptr[in, filename], argv ptr[in, array[ptr[in, string]]], envp ptr[in, array[ptr[in, string]]]) 80 81 getgid() gid 82 getegid() gid 83 setuid(uid uid) 84 setgid(gid gid) 85 getuid() uid 86 geteuid() uid 87 setegid(egid gid) 88 seteuid(euid uid) 89 getsid(pid pid) pid 90 issetugid() 91 setsid() pid 92 setpgid(pid pid, pgid pid) 93 getpgid(pid pid) pid 94 getpgrp(pid pid) pid 95 getpid() pid 96 getppid() pid 97 setreuid(ruid uid, euid uid) 98 setregid(rgid gid, egid gid) 99 setresuid(ruid uid, euid uid, suid uid) 100 setresgid(rgid gid, egid gid, sgid gid) 101 getresuid(ruid ptr[out, uid], euid ptr[out, uid], suid ptr[out, uid]) 102 getresgid(rgid ptr[out, gid], egid ptr[out, gid], sgid ptr[out, gid]) 103 getgroups(size len[list], list ptr[inout, array[gid]]) 104 setgroups(size len[list], list ptr[in, array[gid]]) 105 getpriority(which flags[priority_which], who int32) 106 setpriority(which flags[priority_which], who int32, prio int32) 107 getlogin(buf buffer[out], size len[buf]) 108 setlogin(buf buffer[in]) 109 getloginclass(buf buffer[out], size len[buf]) 110 setloginclass(buf buffer[in]) 111 112 link(old ptr[in, filename], new ptr[in, filename]) 113 linkat(oldfd fd_dir, old ptr[in, filename], newfd fd_dir, new ptr[in, filename], flags flags[linkat_flags]) 114 symlinkat(old ptr[in, filename], newfd fd_dir, new ptr[in, filename]) 115 symlink(old ptr[in, filename], new ptr[in, filename]) 116 unlink(path ptr[in, filename]) 117 unlinkat(fd fd_dir, path ptr[in, filename], flags flags[unlinkat_flags]) 118 readlink(path ptr[in, filename], buf buffer[out], siz len[buf]) 119 readlinkat(fd fd_dir, path ptr[in, filename], buf buffer[out], siz len[buf]) 120 rename(old ptr[in, filename], new ptr[in, filename]) 121 renameat(oldfd fd_dir, old ptr[in, filename], newfd fd_dir, new ptr[in, filename]) 122 mkdir(path ptr[in, filename], mode flags[open_mode]) 123 mkdirat(fd fd_dir, path ptr[in, filename], mode flags[open_mode]) 124 rmdir(path ptr[in, filename]) 125 truncate(file ptr[in, filename], len intptr) 126 ftruncate(fd fd, len intptr) 127 flock(fd fd, op flags[flock_op]) 128 fsync(fd fd) 129 fdatasync(fd fd) 130 sync() 131 freebsd11_getdents(fd fd_dir, ent buffer[out], count len[ent]) 132 chroot(dir ptr[in, filename]) 133 __getcwd(buf buffer[out], size len[buf]) 134 chdir(dir ptr[in, filename]) 135 fchdir(fd fd) 136 copy_file_range(infd fd, inoffp ptr[inout, fileoff[int64]], outfd fd, outoffp ptr[inout, fileoff[int64]], len int64, flags flags[copy_file_range_flags]) 137 __realpathat(dirfd fd, path ptr[in, filename], buf ptr[out, string], size len[buf], flags flags[realpathat_flags]) 138 undelete(path ptr[in, filename]) 139 acct(filename ptr[in, filename, opt]) 140 __specialfd$eventfd(type const[SPECIALFD_EVENTFD], req ptr[in, eventfd], len len[req]) fd 141 setfib(fib int32) 142 143 getrusage(who flags[rusage_who], usage ptr[out, rusage]) 144 getrlimit(res flags[rlimit_type], rlim ptr[out, rlimit]) 145 setrlimit(res flags[rlimit_type], rlim ptr[in, rlimit]) 146 147 freebsd11_statfs(path ptr[in, filename], buf ptr[out, freebsd11_statfs]) 148 freebsd11_fstatfs(fd fd, buf ptr[out, freebsd11_statfs]) 149 statfs(path ptr[in, filename], buf ptr[out, statfs]) 150 fstatfs(fd fd, buf ptr[out, statfs]) 151 152 clock_gettime(id flags[clock_id], tp ptr[out, timespec]) 153 clock_settime(id flags[clock_id], tp ptr[in, timespec]) 154 clock_getres(id flags[clock_id], tp ptr[out, timespec]) 155 clock_nanosleep(id flags[clock_id], flags flags[timer_flags], rqtp ptr[in, timespec], rmtp ptr[out, timespec, opt]) 156 sigaction(signo signo, act ptr[in, sigaction], oact ptr[out, sigaction, opt]) 157 sigprocmask(how flags[sigprocmask_how], set ptr[in, sigset, opt], oset ptr[out, sigset, opt]) 158 sigsuspend(sigmask ptr[in, sigset]) 159 sigpending(set ptr[out, sigset]) 160 sigtimedwait(set ptr[in, sigset], info ptr[out, siginfo, opt], timeout ptr[in, timespec]) 161 sigwaitinfo(set ptr[in, sigset], info ptr[out, siginfo, opt]) 162 sigwait(set ptr[in, sigset], sig intptr) 163 sigqueue(pid pid, signo signo, value sigval) 164 sigaltstack(ss vma, oss ptr[out, intptr, opt]) 165 nanosleep(req ptr[in, timespec], rem ptr[out, timespec, opt]) 166 getitimer(which flags[getitimer_which], cur ptr[out, itimerval]) 167 setitimer(which flags[getitimer_which], new ptr[in, itimerval], old ptr[out, itimerval, opt]) 168 exit(code intptr) 169 wait4(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage, opt]) 170 fork() pid 171 vfork() pid 172 rfork(flags flags[rfork_flags]) 173 umask(mode flags[open_mode]) 174 175 thr_new(param ptr[in, thr_param], param_size bytesize[param]) 176 thr_self(lwpid ptr[out, lwpid]) 177 thr_suspend(timeout ptr[in, timespec]) 178 thr_wake(lwpid lwpid) 179 thr_set_name(lwpid lwpid, name ptr[in, string]) 180 181 rtprio(function flags[rtprio_functions], pid pid, rtp ptr[in, rtprio]) 182 rtprio_thread(function flags[rtprio_functions], lwpid lwpid, rtp ptr[in, rtprio]) 183 184 pollfd { 185 fd fd 186 events flags[pollfd_events, int16] 187 revents const[0, int16] 188 } 189 190 sigaction { 191 sigaction_u ptr[in, text[target]] 192 sa_flags flags[sigaction_flags, int32] 193 sa_mask sigset 194 } 195 196 sigset { 197 mask array[int32, _SIG_WORDS] 198 } 199 200 siginfo { 201 si_signo int32 202 si_errno int32 203 si_code int32 204 si_pid pid 205 si_uid uid 206 si_status int32 207 si_addr intptr 208 si_value sigval 209 reason reason 210 } 211 212 reason [ 213 fault fault_r 214 timer timer_r 215 mesgq mesgq_r 216 poll poll_r 217 spare spare_r 218 ] 219 220 fault_r { 221 trapno int32 222 } 223 224 timer_r { 225 timerid int32 226 overrun int32 227 } 228 229 mesgq_r { 230 mqd int32 231 } 232 233 poll_r { 234 band intptr 235 } 236 237 spare_r { 238 spare1 intptr 239 spare2 array[int32, 7] 240 } 241 242 timespec { 243 sec intptr 244 nsec intptr 245 } 246 247 timeval { 248 sec intptr 249 usec intptr 250 } 251 252 itimerval { 253 interv timeval 254 value timeval 255 } 256 257 # TODO: fd_set needs to be a separate type 258 fd_set { 259 mask0 int64 260 mask1 int64 261 mask2 int64 262 mask3 int64 263 mask4 int64 264 mask5 int64 265 mask6 int64 266 mask7 int64 267 } 268 269 rusage { 270 utime timeval 271 stime timeval 272 maxrss intptr 273 ixrss intptr 274 idrss intptr 275 isrss intptr 276 minflt intptr 277 majflt intptr 278 nswap intptr 279 inblock intptr 280 oublock intptr 281 msgsnd intptr 282 msgrcv intptr 283 signals intptr 284 nvcsw intptr 285 nivcsw intptr 286 } 287 288 rlimit { 289 soft intptr 290 hard intptr 291 } 292 293 rtprio { 294 type flags[rtprio_types, int16] 295 prio int16[0:RTP_PRIO_MAX] 296 } 297 298 thr_param { 299 start_func ptr[in, text[target]] 300 arg intptr 301 stack_base ptr64[in, array[int8]] 302 stack_size bytesize[stack_base, intptr] 303 tls_base ptr64[in, array[int8]] 304 tls_size bytesize[tls_base, intptr] 305 child_tid ptr[out, intptr] 306 parent_tid ptr[out, thr_param_tid] 307 flags flags[thr_flags, int32] 308 rtp ptr[in, rtprio] 309 spare array[intptr, 3] 310 } 311 312 thr_param_tid { 313 lwpid lwpid 314 pad int32 315 } 316 317 flock { 318 type flags[flock_type, int16] 319 whence flags[seek_whence, int16] 320 start intptr 321 len intptr 322 pid pid 323 } 324 325 linger { 326 onoff int32 327 linger int32 328 } 329 330 eventfd { 331 initval int32 332 flags int32 333 } 334 335 pollfd_events = POLLIN, POLLPRI, POLLOUT, POLLERR, POLLHUP, POLLNVAL, POLLRDNORM, POLLRDBAND, POLLWRNORM, POLLWRBAND, POLLINIGNEOF 336 mknod_mode = S_IFREG, S_IFCHR, S_IFBLK, S_IFIFO, S_IFSOCK, open_mode 337 at_flags = 0, AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW, AT_RESOLVE_BENEATH, AT_EMPTY_PATH 338 linkat_flags = 0, AT_SYMLINK_FOLLOW, AT_RESOLVE_BENEATH, AT_EMPTY_PATH 339 unlinkat_flags = 0, AT_REMOVEDIR, AT_RESOLVE_BENEATH 340 flock_op = LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB 341 faccessat_flags = 0, AT_EACCESS, AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW, AT_REMOVEDIR, AT_EMPTY_PATH 342 access_mode = R_OK, W_OK, X_OK, F_OK 343 rusage_who = RUSAGE_SELF, RUSAGE_CHILDREN, RUSAGE_THREAD 344 rlimit_type = RLIMIT_AS, RLIMIT_CORE, RLIMIT_CPU, RLIMIT_DATA, RLIMIT_FSIZE, RLIMIT_MEMLOCK, RLIMIT_NOFILE, RLIMIT_NPROC, RLIMIT_RSS, RLIMIT_STACK 345 clock_id = CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID 346 getitimer_which = ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF 347 wait_options = WNOHANG, WUNTRACED, WCONTINUED, WEXITED, WSTOPPED, WCONTINUED, WNOHANG, WNOWAIT 348 timer_flags = 0, TIMER_ABSTIME 349 utimensat_flags = 0, AT_SYMLINK_NOFOLLOW, AT_RESOLVE_BENEATH, AT_EMPTY_PATH 350 fcntl_dupfd = F_DUPFD, F_DUPFD_CLOEXEC 351 fcntl_getflags = F_GETFD, F_GETFL 352 fcntl_lock = F_SETLK, F_SETLKW, F_GETLK 353 fcntl_flags = FD_CLOEXEC 354 fcntl_status = O_APPEND, FASYNC, O_DIRECT, O_NONBLOCK 355 flock_type = F_RDLCK, F_WRLCK, F_UNLCK 356 minherit_flags = INHERIT_SHARE, INHERIT_NONE, INHERIT_COPY, INHERIT_ZERO 357 copy_file_range_flags = 0 358 realpathat_flags = 0 359 chflags_flags = SF_APPEND, SF_ARCHIVED, SF_IMMUTABLE, SF_NOUNLINK, SF_SNAPSHOT, UF_APPEND, UF_ARCHIVE, UF_HIDDEN, UF_IMMUTABLE, UF_NODUMP, UF_NOUNLINK, UF_OFFLINE, UF_OPAQUE, UF_READONLY, UF_REPARSE, UF_SPARSE, UF_SYSTEM 360 rfork_flags = RFPROC, RFNOWAIT, RFFDG, RFCFDG, RFTHREAD, RFSIGSHARE, RFMEM, RFTSIGZMB, RFLINUXTHPN 361 priority_which = PRIO_PROCESS, PRIO_PGRP, PRIO_USER 362 363 rtprio_functions = RTP_LOOKUP, RTP_SET 364 rtprio_types = RTP_PRIO_REALTIME, RTP_PRIO_NORMAL, RTP_PRIO_IDLE 365 thr_flags = THR_SUSPENDED, THR_SYSTEM_SCOPE 366 sigprocmask_how = SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK 367 sigaction_flags = SA_NOCLDSTOP, SA_NOCLDWAIT, SA_ONSTACK, SA_NODEFER, SA_RESETHAND, SA_RESTART, SA_SIGINFO