github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/strace/linux64_arm64.go (about) 1 // Copyright 2019 The gVisor Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 //go:build arm64 16 // +build arm64 17 18 package strace 19 20 import ( 21 "github.com/metacubex/gvisor/pkg/abi" 22 "github.com/metacubex/gvisor/pkg/sentry/arch" 23 ) 24 25 // linuxARM64 provides a mapping of the Linux arm64 syscalls and their argument 26 // types for display / formatting. 27 var linuxARM64 = SyscallMap{ 28 0: makeSyscallInfo("io_setup", Hex, Hex), 29 1: makeSyscallInfo("io_destroy", Hex), 30 2: makeSyscallInfo("io_submit", Hex, Hex, Hex), 31 3: makeSyscallInfo("io_cancel", Hex, Hex, Hex), 32 4: makeSyscallInfo("io_getevents", Hex, Hex, Hex, Hex, Timespec), 33 5: makeSyscallInfo("setxattr", Path, Path, Hex, Hex, Hex), 34 6: makeSyscallInfo("lsetxattr", Path, Path, Hex, Hex, Hex), 35 7: makeSyscallInfo("fsetxattr", FD, Path, Hex, Hex, Hex), 36 8: makeSyscallInfo("getxattr", Path, Path, Hex, Hex), 37 9: makeSyscallInfo("lgetxattr", Path, Path, Hex, Hex), 38 10: makeSyscallInfo("fgetxattr", FD, Path, Hex, Hex), 39 11: makeSyscallInfo("listxattr", Path, Path, Hex), 40 12: makeSyscallInfo("llistxattr", Path, Path, Hex), 41 13: makeSyscallInfo("flistxattr", FD, Path, Hex), 42 14: makeSyscallInfo("removexattr", Path, Path), 43 15: makeSyscallInfo("lremovexattr", Path, Path), 44 16: makeSyscallInfo("fremovexattr", FD, Path), 45 17: makeSyscallInfo("getcwd", PostPath, Hex), 46 18: makeSyscallInfo("lookup_dcookie", Hex, Hex, Hex), 47 19: makeSyscallInfo("eventfd2", Hex, Hex), 48 20: makeSyscallInfo("epoll_create1", Hex), 49 21: makeSyscallInfo("epoll_ctl", FD, EpollCtlOp, FD, EpollEvent), 50 22: makeSyscallInfo("epoll_pwait", FD, EpollEvents, Hex, Hex, SigSet, Hex), 51 23: makeSyscallInfo("dup", FD), 52 24: makeSyscallInfo("dup3", FD, FD, Hex), 53 25: makeSyscallInfo("fcntl", FD, Hex, Hex), 54 26: makeSyscallInfo("inotify_init1", Hex), 55 27: makeSyscallInfo("inotify_add_watch", Hex, Path, Hex), 56 28: makeSyscallInfo("inotify_rm_watch", Hex, Hex), 57 29: makeSyscallInfo("ioctl", FD, Hex, Hex), 58 30: makeSyscallInfo("ioprio_set", Hex, Hex, Hex), 59 31: makeSyscallInfo("ioprio_get", Hex, Hex), 60 32: makeSyscallInfo("flock", FD, Hex), 61 33: makeSyscallInfo("mknodat", FD, Path, Mode, Hex), 62 34: makeSyscallInfo("mkdirat", FD, Path, Hex), 63 35: makeSyscallInfo("unlinkat", FD, Path, Hex), 64 36: makeSyscallInfo("symlinkat", Path, FD, Path), 65 37: makeSyscallInfo("linkat", FD, Path, Hex, Path, Hex), 66 38: makeSyscallInfo("renameat", FD, Path, Hex, Path), 67 39: makeSyscallInfo("umount2", Path, Hex), 68 40: makeSyscallInfo("mount", Path, Path, Path, Hex, Path), 69 41: makeSyscallInfo("pivot_root", Path, Path), 70 42: makeSyscallInfo("nfsservctl", Hex, Hex, Hex), 71 43: makeSyscallInfo("statfs", Path, Hex), 72 44: makeSyscallInfo("fstatfs", FD, Hex), 73 45: makeSyscallInfo("truncate", Path, Hex), 74 46: makeSyscallInfo("ftruncate", FD, Hex), 75 47: makeSyscallInfo("fallocate", FD, Hex, Hex, Hex), 76 48: makeSyscallInfo("faccessat", FD, Path, Oct, Hex), 77 49: makeSyscallInfo("chdir", Path), 78 50: makeSyscallInfo("fchdir", FD), 79 51: makeSyscallInfo("chroot", Path), 80 52: makeSyscallInfo("fchmod", FD, Mode), 81 53: makeSyscallInfo("fchmodat", FD, Path, Mode), 82 54: makeSyscallInfo("fchownat", FD, Path, Hex, Hex, Hex), 83 55: makeSyscallInfo("fchown", FD, Hex, Hex), 84 56: makeSyscallInfo("openat", FD, Path, OpenFlags, Mode), 85 57: makeSyscallInfo("close", FD), 86 58: makeSyscallInfo("vhangup"), 87 59: makeSyscallInfo("pipe2", PipeFDs, Hex), 88 60: makeSyscallInfo("quotactl", Hex, Hex, Hex, Hex), 89 61: makeSyscallInfo("getdents64", FD, Hex, Hex), 90 62: makeSyscallInfo("lseek", Hex, Hex, Hex), 91 63: makeSyscallInfo("read", FD, ReadBuffer, Hex), 92 64: makeSyscallInfo("write", FD, WriteBuffer, Hex), 93 65: makeSyscallInfo("readv", FD, ReadIOVec, Hex), 94 66: makeSyscallInfo("writev", FD, WriteIOVec, Hex), 95 67: makeSyscallInfo("pread64", FD, ReadBuffer, Hex, Hex), 96 68: makeSyscallInfo("pwrite64", FD, WriteBuffer, Hex, Hex), 97 69: makeSyscallInfo("preadv", FD, ReadIOVec, Hex, Hex), 98 70: makeSyscallInfo("pwritev", FD, WriteIOVec, Hex, Hex), 99 71: makeSyscallInfo("sendfile", FD, FD, Hex, Hex), 100 72: makeSyscallInfo("pselect6", Hex, Hex, Hex, Hex, Hex, Hex), 101 73: makeSyscallInfo("ppoll", PollFDs, Hex, Timespec, SigSet, Hex), 102 74: makeSyscallInfo("signalfd4", Hex, Hex, Hex, Hex), 103 75: makeSyscallInfo("vmsplice", FD, Hex, Hex, Hex), 104 76: makeSyscallInfo("splice", FD, Hex, FD, Hex, Hex, Hex), 105 77: makeSyscallInfo("tee", FD, FD, Hex, Hex), 106 78: makeSyscallInfo("readlinkat", FD, Path, ReadBuffer, Hex), 107 79: makeSyscallInfo("fstatat", FD, Path, Stat, Hex), 108 80: makeSyscallInfo("fstat", FD, Stat), 109 81: makeSyscallInfo("sync"), 110 82: makeSyscallInfo("fsync", FD), 111 83: makeSyscallInfo("fdatasync", FD), 112 84: makeSyscallInfo("sync_file_range", FD, Hex, Hex, Hex), 113 85: makeSyscallInfo("timerfd_create", Hex, Hex), 114 86: makeSyscallInfo("timerfd_settime", FD, Hex, ItimerSpec, PostItimerSpec), 115 87: makeSyscallInfo("timerfd_gettime", FD, PostItimerSpec), 116 88: makeSyscallInfo("utimensat", FD, Path, UTimeTimespec, Hex), 117 89: makeSyscallInfo("acct", Hex), 118 90: makeSyscallInfo("capget", CapHeader, PostCapData), 119 91: makeSyscallInfo("capset", CapHeader, CapData), 120 92: makeSyscallInfo("personality", Hex), 121 93: makeSyscallInfo("exit", Hex), 122 94: makeSyscallInfo("exit_group", Hex), 123 95: makeSyscallInfo("waitid", Hex, Hex, Hex, Hex, Rusage), 124 96: makeSyscallInfo("set_tid_address", Hex), 125 97: makeSyscallInfo("unshare", CloneFlags), 126 98: makeSyscallInfo("futex", Hex, FutexOp, Hex, Timespec, Hex, Hex), 127 99: makeSyscallInfo("set_robust_list", Hex, Hex), 128 100: makeSyscallInfo("get_robust_list", Hex, Hex, Hex), 129 101: makeSyscallInfo("nanosleep", Timespec, PostTimespec), 130 102: makeSyscallInfo("getitimer", ItimerType, PostItimerVal), 131 103: makeSyscallInfo("setitimer", ItimerType, ItimerVal, PostItimerVal), 132 104: makeSyscallInfo("kexec_load", Hex, Hex, Hex, Hex), 133 105: makeSyscallInfo("init_module", Hex, Hex, Hex), 134 106: makeSyscallInfo("delete_module", Hex, Hex), 135 107: makeSyscallInfo("timer_create", Hex, Hex, Hex), 136 108: makeSyscallInfo("timer_gettime", Hex, PostItimerSpec), 137 109: makeSyscallInfo("timer_getoverrun", Hex), 138 110: makeSyscallInfo("timer_settime", Hex, Hex, ItimerSpec, PostItimerSpec), 139 111: makeSyscallInfo("timer_delete", Hex), 140 112: makeSyscallInfo("clock_settime", Hex, Timespec), 141 113: makeSyscallInfo("clock_gettime", Hex, PostTimespec), 142 114: makeSyscallInfo("clock_getres", Hex, PostTimespec), 143 115: makeSyscallInfo("clock_nanosleep", Hex, Hex, Timespec, PostTimespec), 144 116: makeSyscallInfo("syslog", Hex, Hex, Hex), 145 117: makeSyscallInfo("ptrace", PtraceRequest, Hex, Hex, Hex), 146 118: makeSyscallInfo("sched_setparam", Hex, Hex), 147 119: makeSyscallInfo("sched_setscheduler", Hex, Hex, Hex), 148 120: makeSyscallInfo("sched_getscheduler", Hex), 149 121: makeSyscallInfo("sched_getparam", Hex, Hex), 150 122: makeSyscallInfo("sched_setaffinity", Hex, Hex, Hex), 151 123: makeSyscallInfo("sched_getaffinity", Hex, Hex, Hex), 152 124: makeSyscallInfo("sched_yield"), 153 125: makeSyscallInfo("sched_get_priority_max", Hex), 154 126: makeSyscallInfo("sched_get_priority_min", Hex), 155 127: makeSyscallInfo("sched_rr_get_interval", Hex, Hex), 156 128: makeSyscallInfo("restart_syscall"), 157 129: makeSyscallInfo("kill", Hex, Signal), 158 130: makeSyscallInfo("tkill", Hex, Signal), 159 131: makeSyscallInfo("tgkill", Hex, Hex, Signal), 160 132: makeSyscallInfo("sigaltstack", Hex, Hex), 161 133: makeSyscallInfo("rt_sigsuspend", Hex), 162 134: makeSyscallInfo("rt_sigaction", Signal, SigAction, PostSigAction, Hex), 163 135: makeSyscallInfo("rt_sigprocmask", SignalMaskAction, SigSet, PostSigSet, Hex), 164 136: makeSyscallInfo("rt_sigpending", Hex), 165 137: makeSyscallInfo("rt_sigtimedwait", SigSet, Hex, Timespec, Hex), 166 138: makeSyscallInfo("rt_sigqueueinfo", Hex, Signal, Hex), 167 139: makeSyscallInfo("rt_sigreturn"), 168 140: makeSyscallInfo("setpriority", Hex, Hex, Hex), 169 141: makeSyscallInfo("getpriority", Hex, Hex), 170 142: makeSyscallInfo("reboot", Hex, Hex, Hex, Hex), 171 143: makeSyscallInfo("setregid", Hex, Hex), 172 144: makeSyscallInfo("setgid", Hex), 173 145: makeSyscallInfo("setreuid", Hex, Hex), 174 146: makeSyscallInfo("setuid", Hex), 175 147: makeSyscallInfo("setresuid", Hex, Hex, Hex), 176 148: makeSyscallInfo("getresuid", Hex, Hex, Hex), 177 149: makeSyscallInfo("setresgid", Hex, Hex, Hex), 178 150: makeSyscallInfo("getresgid", Hex, Hex, Hex), 179 151: makeSyscallInfo("setfsuid", Hex), 180 152: makeSyscallInfo("setfsgid", Hex), 181 153: makeSyscallInfo("times", Hex), 182 154: makeSyscallInfo("setpgid", Hex, Hex), 183 155: makeSyscallInfo("getpgid", Hex), 184 156: makeSyscallInfo("getsid", Hex), 185 157: makeSyscallInfo("setsid"), 186 158: makeSyscallInfo("getgroups", Hex, Hex), 187 159: makeSyscallInfo("setgroups", Hex, Hex), 188 160: makeSyscallInfo("uname", Uname), 189 161: makeSyscallInfo("sethostname", Hex, Hex), 190 162: makeSyscallInfo("setdomainname", Hex, Hex), 191 163: makeSyscallInfo("getrlimit", Hex, Hex), 192 164: makeSyscallInfo("setrlimit", Hex, Hex), 193 165: makeSyscallInfo("getrusage", Hex, Rusage), 194 166: makeSyscallInfo("umask", Hex), 195 167: makeSyscallInfo("prctl", Hex, Hex, Hex, Hex, Hex), 196 168: makeSyscallInfo("getcpu", Hex, Hex, Hex), 197 169: makeSyscallInfo("gettimeofday", Timeval, Hex), 198 170: makeSyscallInfo("settimeofday", Timeval, Hex), 199 171: makeSyscallInfo("adjtimex", Hex), 200 172: makeSyscallInfo("getpid"), 201 173: makeSyscallInfo("getppid"), 202 174: makeSyscallInfo("getuid"), 203 175: makeSyscallInfo("geteuid"), 204 176: makeSyscallInfo("getgid"), 205 177: makeSyscallInfo("getegid"), 206 178: makeSyscallInfo("gettid"), 207 179: makeSyscallInfo("sysinfo", Hex), 208 180: makeSyscallInfo("mq_open", Hex, Hex, Hex, Hex), 209 181: makeSyscallInfo("mq_unlink", Hex), 210 182: makeSyscallInfo("mq_timedsend", Hex, Hex, Hex, Hex, Hex), 211 183: makeSyscallInfo("mq_timedreceive", Hex, Hex, Hex, Hex, Hex), 212 184: makeSyscallInfo("mq_notify", Hex, Hex), 213 185: makeSyscallInfo("mq_getsetattr", Hex, Hex, Hex), 214 186: makeSyscallInfo("msgget", Hex, Hex), 215 187: makeSyscallInfo("msgctl", Hex, Hex, Hex), 216 188: makeSyscallInfo("msgrcv", Hex, Hex, Hex, Hex, Hex), 217 189: makeSyscallInfo("msgsnd", Hex, Hex, Hex, Hex), 218 190: makeSyscallInfo("semget", Hex, Hex, Hex), 219 191: makeSyscallInfo("semctl", Hex, Hex, Hex, Hex), 220 192: makeSyscallInfo("semtimedop", Hex, Hex, Hex, Hex), 221 193: makeSyscallInfo("semop", Hex, Hex, Hex), 222 194: makeSyscallInfo("shmget", Hex, Hex, Hex), 223 195: makeSyscallInfo("shmctl", Hex, Hex, Hex), 224 196: makeSyscallInfo("shmat", Hex, Hex, Hex), 225 197: makeSyscallInfo("shmdt", Hex), 226 198: makeSyscallInfo("socket", SockFamily, SockType, SockProtocol), 227 199: makeSyscallInfo("socketpair", SockFamily, SockType, SockProtocol, Hex), 228 200: makeSyscallInfo("bind", FD, SockAddr, Hex), 229 201: makeSyscallInfo("listen", FD, Hex), 230 202: makeSyscallInfo("accept", FD, PostSockAddr, SockLen), 231 203: makeSyscallInfo("connect", FD, SockAddr, Hex), 232 204: makeSyscallInfo("getsockname", FD, PostSockAddr, SockLen), 233 205: makeSyscallInfo("getpeername", FD, PostSockAddr, SockLen), 234 206: makeSyscallInfo("sendto", FD, Hex, Hex, Hex, SockAddr, Hex), 235 207: makeSyscallInfo("recvfrom", FD, Hex, Hex, Hex, PostSockAddr, SockLen), 236 208: makeSyscallInfo("setsockopt", FD, Hex, Hex, Hex, Hex), 237 209: makeSyscallInfo("getsockopt", FD, Hex, Hex, Hex, Hex), 238 210: makeSyscallInfo("shutdown", FD, Hex), 239 211: makeSyscallInfo("sendmsg", FD, SendMsgHdr, Hex), 240 212: makeSyscallInfo("recvmsg", FD, RecvMsgHdr, Hex), 241 213: makeSyscallInfo("readahead", Hex, Hex, Hex), 242 214: makeSyscallInfo("brk", Hex), 243 215: makeSyscallInfo("munmap", Hex, Hex), 244 216: makeSyscallInfo("mremap", Hex, Hex, Hex, Hex, Hex), 245 217: makeSyscallInfo("add_key", Hex, Hex, Hex, Hex, Hex), 246 218: makeSyscallInfo("request_key", Hex, Hex, Hex, Hex), 247 219: makeSyscallInfo("keyctl", Hex, Hex, Hex, Hex, Hex), 248 220: makeSyscallInfo("clone", CloneFlags, Hex, Hex, Hex, Hex), 249 221: makeSyscallInfo("execve", Path, ExecveStringVector, ExecveStringVector), 250 222: makeSyscallInfo("mmap", Hex, Hex, MmapProt, MmapFlags, FD, Hex), 251 223: makeSyscallInfo("fadvise64", FD, Hex, Hex, Hex), 252 224: makeSyscallInfo("swapon", Hex, Hex), 253 225: makeSyscallInfo("swapoff", Hex), 254 226: makeSyscallInfo("mprotect", Hex, Hex, Hex), 255 227: makeSyscallInfo("msync", Hex, Hex, Hex), 256 228: makeSyscallInfo("mlock", Hex, Hex), 257 229: makeSyscallInfo("munlock", Hex, Hex), 258 230: makeSyscallInfo("mlockall", Hex), 259 231: makeSyscallInfo("munlockall"), 260 232: makeSyscallInfo("mincore", Hex, Hex, Hex), 261 233: makeSyscallInfo("madvise", Hex, Hex, Hex), 262 234: makeSyscallInfo("remap_file_pages", Hex, Hex, Hex, Hex, Hex), 263 235: makeSyscallInfo("mbind", Hex, Hex, Hex, Hex, Hex, Hex), 264 236: makeSyscallInfo("get_mempolicy", Hex, Hex, Hex, Hex, Hex), 265 237: makeSyscallInfo("set_mempolicy", Hex, Hex, Hex), 266 238: makeSyscallInfo("migrate_pages", Hex, Hex, Hex, Hex), 267 239: makeSyscallInfo("move_pages", Hex, Hex, Hex, Hex, Hex, Hex), 268 240: makeSyscallInfo("rt_tgsigqueueinfo", Hex, Hex, Signal, Hex), 269 241: makeSyscallInfo("perf_event_open", Hex, Hex, Hex, Hex, Hex), 270 242: makeSyscallInfo("accept4", FD, PostSockAddr, SockLen, SockFlags), 271 243: makeSyscallInfo("recvmmsg", FD, Hex, Hex, Hex, Hex), 272 273 260: makeSyscallInfo("wait4", Hex, Hex, Hex, Rusage), 274 261: makeSyscallInfo("prlimit64", Hex, Hex, Hex, Hex), 275 262: makeSyscallInfo("fanotify_init", Hex, Hex), 276 263: makeSyscallInfo("fanotify_mark", Hex, Hex, Hex, Hex, Hex), 277 264: makeSyscallInfo("name_to_handle_at", FD, Hex, Hex, Hex, Hex), 278 265: makeSyscallInfo("open_by_handle_at", FD, Hex, Hex), 279 266: makeSyscallInfo("clock_adjtime", Hex, Hex), 280 267: makeSyscallInfo("syncfs", FD), 281 268: makeSyscallInfo("setns", FD, Hex), 282 269: makeSyscallInfo("sendmmsg", FD, Hex, Hex, Hex), 283 270: makeSyscallInfo("process_vm_readv", Hex, ReadIOVec, Hex, IOVec, Hex, Hex), 284 271: makeSyscallInfo("process_vm_writev", Hex, IOVec, Hex, WriteIOVec, Hex, Hex), 285 272: makeSyscallInfo("kcmp", Hex, Hex, Hex, Hex, Hex), 286 273: makeSyscallInfo("finit_module", Hex, Hex, Hex), 287 274: makeSyscallInfo("sched_setattr", Hex, Hex, Hex), 288 275: makeSyscallInfo("sched_getattr", Hex, Hex, Hex), 289 276: makeSyscallInfo("renameat2", FD, Path, Hex, Path, Hex), 290 277: makeSyscallInfo("seccomp", Hex, Hex, Hex), 291 278: makeSyscallInfo("getrandom", Hex, Hex, Hex), 292 279: makeSyscallInfo("memfd_create", Path, Hex), 293 280: makeSyscallInfo("bpf", Hex, Hex, Hex), 294 281: makeSyscallInfo("execveat", FD, Path, Hex, Hex, Hex), 295 282: makeSyscallInfo("userfaultfd", Hex), 296 283: makeSyscallInfo("membarrier", Hex), 297 284: makeSyscallInfo("mlock2", Hex, Hex, Hex), 298 285: makeSyscallInfo("copy_file_range", FD, Hex, FD, Hex, Hex, Hex), 299 286: makeSyscallInfo("preadv2", FD, ReadIOVec, Hex, Hex, Hex), 300 287: makeSyscallInfo("pwritev2", FD, WriteIOVec, Hex, Hex, Hex), 301 291: makeSyscallInfo("statx", FD, Path, Hex, Hex, Hex), 302 292: makeSyscallInfo("io_pgetevents", Hex, Hex, Hex, Hex, Timespec, SigSet), 303 293: makeSyscallInfo("rseq", Hex, Hex, Hex, Hex), 304 424: makeSyscallInfo("pidfd_send_signal", FD, Signal, Hex, Hex), 305 425: makeSyscallInfo("io_uring_setup", Hex, Hex), 306 426: makeSyscallInfo("io_uring_enter", FD, Hex, Hex, Hex, SigSet, Hex), 307 427: makeSyscallInfo("io_uring_register", FD, Hex, Hex, Hex), 308 428: makeSyscallInfo("open_tree", FD, Path, Hex), 309 429: makeSyscallInfo("move_mount", FD, Path, FD, Path, Hex), 310 430: makeSyscallInfo("fsopen", Path, Hex), // Not quite a path, but close. 311 431: makeSyscallInfo("fsconfig", FD, Hex, Hex, Hex, Hex), 312 432: makeSyscallInfo("fsmount", FD, Hex, Hex), 313 433: makeSyscallInfo("fspick", FD, Path, Hex), 314 434: makeSyscallInfo("pidfd_open", Hex, Hex), 315 435: makeSyscallInfo("clone3", Hex, Hex), 316 436: makeSyscallInfo("close_range", FD, FD, CloseRangeFlags), 317 441: makeSyscallInfo("epoll_pwait2", FD, EpollEvents, Hex, Timespec, SigSet), 318 } 319 320 func init() { 321 syscallTables = append(syscallTables, 322 syscallTable{ 323 os: abi.Linux, 324 arch: arch.ARM64, 325 syscalls: linuxARM64}) 326 }