github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/syscalls/linux/linux64.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 // Package linux provides syscall tables for amd64 and arm64 Linux. 16 package linux 17 18 import ( 19 "github.com/MerlinKodo/gvisor/pkg/abi" 20 "github.com/MerlinKodo/gvisor/pkg/abi/linux" 21 "github.com/MerlinKodo/gvisor/pkg/errors/linuxerr" 22 "github.com/MerlinKodo/gvisor/pkg/hostarch" 23 "github.com/MerlinKodo/gvisor/pkg/sentry/arch" 24 "github.com/MerlinKodo/gvisor/pkg/sentry/kernel" 25 "github.com/MerlinKodo/gvisor/pkg/sentry/syscalls" 26 ) 27 28 const ( 29 // LinuxSysname is the OS name advertised by gVisor. 30 LinuxSysname = "Linux" 31 32 // LinuxRelease is the Linux release version number advertised by gVisor. 33 LinuxRelease = "4.4.0" 34 35 // LinuxVersion is the version info advertised by gVisor. 36 LinuxVersion = "#1 SMP Sun Jan 10 15:06:54 PST 2016" 37 ) 38 39 // AMD64 is a table of Linux amd64 syscall API with the corresponding syscall 40 // numbers from Linux 4.4. 41 var AMD64 = &kernel.SyscallTable{ 42 OS: abi.Linux, 43 Arch: arch.AMD64, 44 Version: kernel.Version{ 45 // Version 4.4 is chosen as a stable, longterm version of Linux, which 46 // guides the interface provided by this syscall table. The build 47 // version is that for a clean build with default kernel config, at 5 48 // minutes after v4.4 was tagged. 49 Sysname: LinuxSysname, 50 Release: LinuxRelease, 51 Version: LinuxVersion, 52 }, 53 AuditNumber: linux.AUDIT_ARCH_X86_64, 54 Table: map[uintptr]kernel.Syscall{ 55 0: syscalls.SupportedPoint("read", Read, PointRead), 56 1: syscalls.SupportedPoint("write", Write, PointWrite), 57 2: syscalls.SupportedPoint("open", Open, PointOpen), 58 3: syscalls.SupportedPoint("close", Close, PointClose), 59 4: syscalls.Supported("stat", Stat), 60 5: syscalls.Supported("fstat", Fstat), 61 6: syscalls.Supported("lstat", Lstat), 62 7: syscalls.Supported("poll", Poll), 63 8: syscalls.Supported("lseek", Lseek), 64 9: syscalls.Supported("mmap", Mmap), 65 10: syscalls.Supported("mprotect", Mprotect), 66 11: syscalls.Supported("munmap", Munmap), 67 12: syscalls.Supported("brk", Brk), 68 13: syscalls.Supported("rt_sigaction", RtSigaction), 69 14: syscalls.Supported("rt_sigprocmask", RtSigprocmask), 70 15: syscalls.Supported("rt_sigreturn", RtSigreturn), 71 16: syscalls.Supported("ioctl", Ioctl), 72 17: syscalls.SupportedPoint("pread64", Pread64, PointPread64), 73 18: syscalls.SupportedPoint("pwrite64", Pwrite64, PointPwrite64), 74 19: syscalls.SupportedPoint("readv", Readv, PointReadv), 75 20: syscalls.SupportedPoint("writev", Writev, PointWritev), 76 21: syscalls.Supported("access", Access), 77 22: syscalls.SupportedPoint("pipe", Pipe, PointPipe), 78 23: syscalls.Supported("select", Select), 79 24: syscalls.Supported("sched_yield", SchedYield), 80 25: syscalls.Supported("mremap", Mremap), 81 26: syscalls.PartiallySupported("msync", Msync, "Full data flush is not guaranteed at this time.", nil), 82 27: syscalls.PartiallySupported("mincore", Mincore, "Stub implementation. The sandbox does not have access to this information. Reports all mapped pages are resident.", nil), 83 28: syscalls.PartiallySupported("madvise", Madvise, "Options MADV_DONTNEED, MADV_DONTFORK are supported. Other advice is ignored.", nil), 84 29: syscalls.PartiallySupported("shmget", Shmget, "Option SHM_HUGETLB is not supported.", nil), 85 30: syscalls.PartiallySupported("shmat", Shmat, "Option SHM_RND is not supported.", nil), 86 31: syscalls.PartiallySupported("shmctl", Shmctl, "Options SHM_LOCK, SHM_UNLOCK are not supported.", nil), 87 32: syscalls.SupportedPoint("dup", Dup, PointDup), 88 33: syscalls.SupportedPoint("dup2", Dup2, PointDup2), 89 34: syscalls.Supported("pause", Pause), 90 35: syscalls.Supported("nanosleep", Nanosleep), 91 36: syscalls.Supported("getitimer", Getitimer), 92 37: syscalls.Supported("alarm", Alarm), 93 38: syscalls.Supported("setitimer", Setitimer), 94 39: syscalls.Supported("getpid", Getpid), 95 40: syscalls.Supported("sendfile", Sendfile), 96 41: syscalls.SupportedPoint("socket", Socket, PointSocket), 97 42: syscalls.SupportedPoint("connect", Connect, PointConnect), 98 43: syscalls.SupportedPoint("accept", Accept, PointAccept), 99 44: syscalls.Supported("sendto", SendTo), 100 45: syscalls.Supported("recvfrom", RecvFrom), 101 46: syscalls.Supported("sendmsg", SendMsg), 102 47: syscalls.Supported("recvmsg", RecvMsg), 103 48: syscalls.Supported("shutdown", Shutdown), 104 49: syscalls.SupportedPoint("bind", Bind, PointBind), 105 50: syscalls.Supported("listen", Listen), 106 51: syscalls.Supported("getsockname", GetSockName), 107 52: syscalls.Supported("getpeername", GetPeerName), 108 53: syscalls.SupportedPoint("socketpair", SocketPair, PointSocketpair), 109 54: syscalls.Supported("setsockopt", SetSockOpt), 110 55: syscalls.Supported("getsockopt", GetSockOpt), 111 56: syscalls.PartiallySupportedPoint("clone", Clone, PointClone, "Options CLONE_PIDFD, CLONE_NEWCGROUP, CLONE_PARENT, CLONE_NEWTIME, CLONE_CLEAR_SIGHAND, and CLONE_SYSVSEM not supported.", nil), 112 57: syscalls.SupportedPoint("fork", Fork, PointFork), 113 58: syscalls.SupportedPoint("vfork", Vfork, PointVfork), 114 59: syscalls.SupportedPoint("execve", Execve, PointExecve), 115 60: syscalls.Supported("exit", Exit), 116 61: syscalls.Supported("wait4", Wait4), 117 62: syscalls.Supported("kill", Kill), 118 63: syscalls.Supported("uname", Uname), 119 64: syscalls.Supported("semget", Semget), 120 65: syscalls.PartiallySupported("semop", Semop, "Option SEM_UNDO not supported.", nil), 121 66: syscalls.Supported("semctl", Semctl), 122 67: syscalls.Supported("shmdt", Shmdt), 123 68: syscalls.Supported("msgget", Msgget), 124 69: syscalls.Supported("msgsnd", Msgsnd), 125 70: syscalls.Supported("msgrcv", Msgrcv), 126 71: syscalls.Supported("msgctl", Msgctl), 127 72: syscalls.SupportedPoint("fcntl", Fcntl, PointFcntl), 128 73: syscalls.Supported("flock", Flock), 129 74: syscalls.Supported("fsync", Fsync), 130 75: syscalls.Supported("fdatasync", Fdatasync), 131 76: syscalls.Supported("truncate", Truncate), 132 77: syscalls.Supported("ftruncate", Ftruncate), 133 78: syscalls.Supported("getdents", Getdents), 134 79: syscalls.Supported("getcwd", Getcwd), 135 80: syscalls.SupportedPoint("chdir", Chdir, PointChdir), 136 81: syscalls.SupportedPoint("fchdir", Fchdir, PointFchdir), 137 82: syscalls.Supported("rename", Rename), 138 83: syscalls.Supported("mkdir", Mkdir), 139 84: syscalls.Supported("rmdir", Rmdir), 140 85: syscalls.SupportedPoint("creat", Creat, PointCreat), 141 86: syscalls.Supported("link", Link), 142 87: syscalls.Supported("unlink", Unlink), 143 88: syscalls.Supported("symlink", Symlink), 144 89: syscalls.Supported("readlink", Readlink), 145 90: syscalls.Supported("chmod", Chmod), 146 91: syscalls.Supported("fchmod", Fchmod), 147 92: syscalls.Supported("chown", Chown), 148 93: syscalls.Supported("fchown", Fchown), 149 94: syscalls.Supported("lchown", Lchown), 150 95: syscalls.Supported("umask", Umask), 151 96: syscalls.Supported("gettimeofday", Gettimeofday), 152 97: syscalls.Supported("getrlimit", Getrlimit), 153 98: syscalls.PartiallySupported("getrusage", Getrusage, "Fields ru_maxrss, ru_minflt, ru_majflt, ru_inblock, ru_oublock are not supported. Fields ru_utime and ru_stime have low precision.", nil), 154 99: syscalls.PartiallySupported("sysinfo", Sysinfo, "Fields loads, sharedram, bufferram, totalswap, freeswap, totalhigh, freehigh not supported.", nil), 155 100: syscalls.Supported("times", Times), 156 101: syscalls.PartiallySupported("ptrace", Ptrace, "Options PTRACE_PEEKSIGINFO, PTRACE_SECCOMP_GET_FILTER not supported.", nil), 157 102: syscalls.Supported("getuid", Getuid), 158 103: syscalls.PartiallySupported("syslog", Syslog, "Outputs a dummy message for security reasons.", nil), 159 104: syscalls.Supported("getgid", Getgid), 160 105: syscalls.SupportedPoint("setuid", Setuid, PointSetuid), 161 106: syscalls.SupportedPoint("setgid", Setgid, PointSetgid), 162 107: syscalls.Supported("geteuid", Geteuid), 163 108: syscalls.Supported("getegid", Getegid), 164 109: syscalls.Supported("setpgid", Setpgid), 165 110: syscalls.Supported("getppid", Getppid), 166 111: syscalls.Supported("getpgrp", Getpgrp), 167 112: syscalls.SupportedPoint("setsid", Setsid, PointSetsid), 168 113: syscalls.Supported("setreuid", Setreuid), 169 114: syscalls.Supported("setregid", Setregid), 170 115: syscalls.Supported("getgroups", Getgroups), 171 116: syscalls.Supported("setgroups", Setgroups), 172 117: syscalls.SupportedPoint("setresuid", Setresuid, PointSetresuid), 173 118: syscalls.Supported("getresuid", Getresuid), 174 119: syscalls.SupportedPoint("setresgid", Setresgid, PointSetresgid), 175 120: syscalls.Supported("getresgid", Getresgid), 176 121: syscalls.Supported("getpgid", Getpgid), 177 122: syscalls.ErrorWithEvent("setfsuid", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/260"}), // TODO(b/112851702) 178 123: syscalls.ErrorWithEvent("setfsgid", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/260"}), // TODO(b/112851702) 179 124: syscalls.Supported("getsid", Getsid), 180 125: syscalls.Supported("capget", Capget), 181 126: syscalls.Supported("capset", Capset), 182 127: syscalls.Supported("rt_sigpending", RtSigpending), 183 128: syscalls.Supported("rt_sigtimedwait", RtSigtimedwait), 184 129: syscalls.Supported("rt_sigqueueinfo", RtSigqueueinfo), 185 130: syscalls.Supported("rt_sigsuspend", RtSigsuspend), 186 131: syscalls.Supported("sigaltstack", Sigaltstack), 187 132: syscalls.Supported("utime", Utime), 188 133: syscalls.Supported("mknod", Mknod), 189 134: syscalls.Error("uselib", linuxerr.ENOSYS, "Obsolete", nil), 190 135: syscalls.ErrorWithEvent("personality", linuxerr.EINVAL, "Unable to change personality.", nil), 191 136: syscalls.ErrorWithEvent("ustat", linuxerr.ENOSYS, "Needs filesystem support.", nil), 192 137: syscalls.Supported("statfs", Statfs), 193 138: syscalls.Supported("fstatfs", Fstatfs), 194 139: syscalls.ErrorWithEvent("sysfs", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/165"}), 195 140: syscalls.PartiallySupported("getpriority", Getpriority, "Stub implementation.", nil), 196 141: syscalls.PartiallySupported("setpriority", Setpriority, "Stub implementation.", nil), 197 142: syscalls.CapError("sched_setparam", linux.CAP_SYS_NICE, "", nil), 198 143: syscalls.PartiallySupported("sched_getparam", SchedGetparam, "Stub implementation.", nil), 199 144: syscalls.PartiallySupported("sched_setscheduler", SchedSetscheduler, "Stub implementation.", nil), 200 145: syscalls.PartiallySupported("sched_getscheduler", SchedGetscheduler, "Stub implementation.", nil), 201 146: syscalls.PartiallySupported("sched_get_priority_max", SchedGetPriorityMax, "Stub implementation.", nil), 202 147: syscalls.PartiallySupported("sched_get_priority_min", SchedGetPriorityMin, "Stub implementation.", nil), 203 148: syscalls.ErrorWithEvent("sched_rr_get_interval", linuxerr.EPERM, "", nil), 204 149: syscalls.PartiallySupported("mlock", Mlock, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 205 150: syscalls.PartiallySupported("munlock", Munlock, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 206 151: syscalls.PartiallySupported("mlockall", Mlockall, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 207 152: syscalls.PartiallySupported("munlockall", Munlockall, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 208 153: syscalls.CapError("vhangup", linux.CAP_SYS_TTY_CONFIG, "", nil), 209 154: syscalls.Error("modify_ldt", linuxerr.EPERM, "", nil), 210 155: syscalls.Supported("pivot_root", PivotRoot), 211 156: syscalls.Error("sysctl", linuxerr.EPERM, "Deprecated. Use /proc/sys instead.", nil), 212 157: syscalls.PartiallySupported("prctl", Prctl, "Not all options are supported.", nil), 213 158: syscalls.PartiallySupported("arch_prctl", ArchPrctl, "Options ARCH_GET_GS, ARCH_SET_GS not supported.", nil), 214 159: syscalls.CapError("adjtimex", linux.CAP_SYS_TIME, "", nil), 215 160: syscalls.PartiallySupported("setrlimit", Setrlimit, "Not all rlimits are enforced.", nil), 216 161: syscalls.SupportedPoint("chroot", Chroot, PointChroot), 217 162: syscalls.Supported("sync", Sync), 218 163: syscalls.CapError("acct", linux.CAP_SYS_PACCT, "", nil), 219 164: syscalls.CapError("settimeofday", linux.CAP_SYS_TIME, "", nil), 220 165: syscalls.Supported("mount", Mount), 221 166: syscalls.Supported("umount2", Umount2), 222 167: syscalls.CapError("swapon", linux.CAP_SYS_ADMIN, "", nil), 223 168: syscalls.CapError("swapoff", linux.CAP_SYS_ADMIN, "", nil), 224 169: syscalls.CapError("reboot", linux.CAP_SYS_BOOT, "", nil), 225 170: syscalls.Supported("sethostname", Sethostname), 226 171: syscalls.Supported("setdomainname", Setdomainname), 227 172: syscalls.CapError("iopl", linux.CAP_SYS_RAWIO, "", nil), 228 173: syscalls.CapError("ioperm", linux.CAP_SYS_RAWIO, "", nil), 229 174: syscalls.CapError("create_module", linux.CAP_SYS_MODULE, "", nil), 230 175: syscalls.CapError("init_module", linux.CAP_SYS_MODULE, "", nil), 231 176: syscalls.CapError("delete_module", linux.CAP_SYS_MODULE, "", nil), 232 177: syscalls.Error("get_kernel_syms", linuxerr.ENOSYS, "Not supported in Linux > 2.6.", nil), 233 178: syscalls.Error("query_module", linuxerr.ENOSYS, "Not supported in Linux > 2.6.", nil), 234 179: syscalls.CapError("quotactl", linux.CAP_SYS_ADMIN, "", nil), // requires cap_sys_admin for most operations 235 180: syscalls.Error("nfsservctl", linuxerr.ENOSYS, "Removed after Linux 3.1.", nil), 236 181: syscalls.Error("getpmsg", linuxerr.ENOSYS, "Not implemented in Linux.", nil), 237 182: syscalls.Error("putpmsg", linuxerr.ENOSYS, "Not implemented in Linux.", nil), 238 183: syscalls.PartiallySupported("afs_syscall", AFSSyscall, "Test implementation.", nil), 239 184: syscalls.Error("tuxcall", linuxerr.ENOSYS, "Not implemented in Linux.", nil), 240 185: syscalls.Error("security", linuxerr.ENOSYS, "Not implemented in Linux.", nil), 241 186: syscalls.Supported("gettid", Gettid), 242 187: syscalls.Supported("readahead", Readahead), 243 188: syscalls.Supported("setxattr", SetXattr), 244 189: syscalls.Supported("lsetxattr", Lsetxattr), 245 190: syscalls.Supported("fsetxattr", Fsetxattr), 246 191: syscalls.Supported("getxattr", GetXattr), 247 192: syscalls.Supported("lgetxattr", Lgetxattr), 248 193: syscalls.Supported("fgetxattr", Fgetxattr), 249 194: syscalls.Supported("listxattr", ListXattr), 250 195: syscalls.Supported("llistxattr", Llistxattr), 251 196: syscalls.Supported("flistxattr", Flistxattr), 252 197: syscalls.Supported("removexattr", RemoveXattr), 253 198: syscalls.Supported("lremovexattr", Lremovexattr), 254 199: syscalls.Supported("fremovexattr", Fremovexattr), 255 200: syscalls.Supported("tkill", Tkill), 256 201: syscalls.Supported("time", Time), 257 202: syscalls.PartiallySupported("futex", Futex, "Robust futexes not supported.", nil), 258 203: syscalls.PartiallySupported("sched_setaffinity", SchedSetaffinity, "Stub implementation.", nil), 259 204: syscalls.PartiallySupported("sched_getaffinity", SchedGetaffinity, "Stub implementation.", nil), 260 205: syscalls.Error("set_thread_area", linuxerr.ENOSYS, "Expected to return ENOSYS on 64-bit", nil), 261 206: syscalls.PartiallySupported("io_setup", IoSetup, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 262 207: syscalls.PartiallySupported("io_destroy", IoDestroy, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 263 208: syscalls.PartiallySupported("io_getevents", IoGetevents, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 264 209: syscalls.PartiallySupported("io_submit", IoSubmit, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 265 210: syscalls.PartiallySupported("io_cancel", IoCancel, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 266 211: syscalls.Error("get_thread_area", linuxerr.ENOSYS, "Expected to return ENOSYS on 64-bit", nil), 267 212: syscalls.CapError("lookup_dcookie", linux.CAP_SYS_ADMIN, "", nil), 268 213: syscalls.Supported("epoll_create", EpollCreate), 269 214: syscalls.ErrorWithEvent("epoll_ctl_old", linuxerr.ENOSYS, "Deprecated.", nil), 270 215: syscalls.ErrorWithEvent("epoll_wait_old", linuxerr.ENOSYS, "Deprecated.", nil), 271 216: syscalls.ErrorWithEvent("remap_file_pages", linuxerr.ENOSYS, "Deprecated since Linux 3.16.", nil), 272 217: syscalls.Supported("getdents64", Getdents64), 273 218: syscalls.Supported("set_tid_address", SetTidAddress), 274 219: syscalls.Supported("restart_syscall", RestartSyscall), 275 220: syscalls.Supported("semtimedop", Semtimedop), 276 221: syscalls.PartiallySupported("fadvise64", Fadvise64, "The syscall is 'supported', but ignores all provided advice.", nil), 277 222: syscalls.Supported("timer_create", TimerCreate), 278 223: syscalls.Supported("timer_settime", TimerSettime), 279 224: syscalls.Supported("timer_gettime", TimerGettime), 280 225: syscalls.Supported("timer_getoverrun", TimerGetoverrun), 281 226: syscalls.Supported("timer_delete", TimerDelete), 282 227: syscalls.Supported("clock_settime", ClockSettime), 283 228: syscalls.Supported("clock_gettime", ClockGettime), 284 229: syscalls.Supported("clock_getres", ClockGetres), 285 230: syscalls.Supported("clock_nanosleep", ClockNanosleep), 286 231: syscalls.Supported("exit_group", ExitGroup), 287 232: syscalls.Supported("epoll_wait", EpollWait), 288 233: syscalls.Supported("epoll_ctl", EpollCtl), 289 234: syscalls.Supported("tgkill", Tgkill), 290 235: syscalls.Supported("utimes", Utimes), 291 236: syscalls.Error("vserver", linuxerr.ENOSYS, "Not implemented by Linux", nil), 292 237: syscalls.PartiallySupported("mbind", Mbind, "Stub implementation. Only a single NUMA node is advertised, and mempolicy is ignored accordingly, but mbind() will succeed and has effects reflected by get_mempolicy.", []string{"gvisor.dev/issue/262"}), 293 238: syscalls.PartiallySupported("set_mempolicy", SetMempolicy, "Stub implementation.", nil), 294 239: syscalls.PartiallySupported("get_mempolicy", GetMempolicy, "Stub implementation.", nil), 295 240: syscalls.Supported("mq_open", MqOpen), 296 241: syscalls.Supported("mq_unlink", MqUnlink), 297 242: syscalls.ErrorWithEvent("mq_timedsend", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 298 243: syscalls.ErrorWithEvent("mq_timedreceive", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 299 244: syscalls.ErrorWithEvent("mq_notify", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 300 245: syscalls.ErrorWithEvent("mq_getsetattr", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 301 246: syscalls.CapError("kexec_load", linux.CAP_SYS_BOOT, "", nil), 302 247: syscalls.Supported("waitid", Waitid), 303 248: syscalls.Error("add_key", linuxerr.EACCES, "Not available to user.", nil), 304 249: syscalls.Error("request_key", linuxerr.EACCES, "Not available to user.", nil), 305 250: syscalls.PartiallySupported("keyctl", Keyctl, "Only supports session keyrings with zero keys in them.", nil), 306 251: syscalls.CapError("ioprio_set", linux.CAP_SYS_ADMIN, "", nil), // requires cap_sys_nice or cap_sys_admin (depending) 307 252: syscalls.CapError("ioprio_get", linux.CAP_SYS_ADMIN, "", nil), // requires cap_sys_nice or cap_sys_admin (depending) 308 253: syscalls.PartiallySupportedPoint("inotify_init", InotifyInit, PointInotifyInit, "inotify events are only available inside the sandbox.", nil), 309 254: syscalls.PartiallySupportedPoint("inotify_add_watch", InotifyAddWatch, PointInotifyAddWatch, "inotify events are only available inside the sandbox.", nil), 310 255: syscalls.PartiallySupportedPoint("inotify_rm_watch", InotifyRmWatch, PointInotifyRmWatch, "inotify events are only available inside the sandbox.", nil), 311 256: syscalls.CapError("migrate_pages", linux.CAP_SYS_NICE, "", nil), 312 257: syscalls.SupportedPoint("openat", Openat, PointOpenat), 313 258: syscalls.Supported("mkdirat", Mkdirat), 314 259: syscalls.Supported("mknodat", Mknodat), 315 260: syscalls.Supported("fchownat", Fchownat), 316 261: syscalls.Supported("futimesat", Futimesat), 317 262: syscalls.Supported("newfstatat", Newfstatat), 318 263: syscalls.Supported("unlinkat", Unlinkat), 319 264: syscalls.Supported("renameat", Renameat), 320 265: syscalls.Supported("linkat", Linkat), 321 266: syscalls.Supported("symlinkat", Symlinkat), 322 267: syscalls.Supported("readlinkat", Readlinkat), 323 268: syscalls.Supported("fchmodat", Fchmodat), 324 269: syscalls.Supported("faccessat", Faccessat), 325 270: syscalls.Supported("pselect6", Pselect6), 326 271: syscalls.Supported("ppoll", Ppoll), 327 272: syscalls.PartiallySupported("unshare", Unshare, "Mount, cgroup namespaces not supported. Network namespaces supported but must be empty.", nil), 328 273: syscalls.Supported("set_robust_list", SetRobustList), 329 274: syscalls.Supported("get_robust_list", GetRobustList), 330 275: syscalls.Supported("splice", Splice), 331 276: syscalls.Supported("tee", Tee), 332 277: syscalls.Supported("sync_file_range", SyncFileRange), 333 278: syscalls.ErrorWithEvent("vmsplice", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/138"}), // TODO(b/29354098) 334 279: syscalls.CapError("move_pages", linux.CAP_SYS_NICE, "", nil), // requires cap_sys_nice (mostly) 335 280: syscalls.Supported("utimensat", Utimensat), 336 281: syscalls.Supported("epoll_pwait", EpollPwait), 337 282: syscalls.SupportedPoint("signalfd", Signalfd, PointSignalfd), 338 283: syscalls.SupportedPoint("timerfd_create", TimerfdCreate, PointTimerfdCreate), 339 284: syscalls.SupportedPoint("eventfd", Eventfd, PointEventfd), 340 285: syscalls.PartiallySupported("fallocate", Fallocate, "Not all options are supported.", nil), 341 286: syscalls.SupportedPoint("timerfd_settime", TimerfdSettime, PointTimerfdSettime), 342 287: syscalls.SupportedPoint("timerfd_gettime", TimerfdGettime, PointTimerfdGettime), 343 288: syscalls.SupportedPoint("accept4", Accept4, PointAccept4), 344 289: syscalls.SupportedPoint("signalfd4", Signalfd4, PointSignalfd4), 345 290: syscalls.SupportedPoint("eventfd2", Eventfd2, PointEventfd2), 346 291: syscalls.Supported("epoll_create1", EpollCreate1), 347 292: syscalls.SupportedPoint("dup3", Dup3, PointDup3), 348 293: syscalls.SupportedPoint("pipe2", Pipe2, PointPipe2), 349 294: syscalls.PartiallySupportedPoint("inotify_init1", InotifyInit1, PointInotifyInit1, "inotify events are only available inside the sandbox.", nil), 350 295: syscalls.SupportedPoint("preadv", Preadv, PointPreadv), 351 296: syscalls.SupportedPoint("pwritev", Pwritev, PointPwritev), 352 297: syscalls.Supported("rt_tgsigqueueinfo", RtTgsigqueueinfo), 353 298: syscalls.ErrorWithEvent("perf_event_open", linuxerr.ENODEV, "No support for perf counters", nil), 354 299: syscalls.Supported("recvmmsg", RecvMMsg), 355 300: syscalls.ErrorWithEvent("fanotify_init", linuxerr.ENOSYS, "Needs CONFIG_FANOTIFY", nil), 356 301: syscalls.ErrorWithEvent("fanotify_mark", linuxerr.ENOSYS, "Needs CONFIG_FANOTIFY", nil), 357 302: syscalls.SupportedPoint("prlimit64", Prlimit64, PointPrlimit64), 358 303: syscalls.Error("name_to_handle_at", linuxerr.EOPNOTSUPP, "Not supported by gVisor filesystems", nil), 359 304: syscalls.Error("open_by_handle_at", linuxerr.EOPNOTSUPP, "Not supported by gVisor filesystems", nil), 360 305: syscalls.CapError("clock_adjtime", linux.CAP_SYS_TIME, "", nil), 361 306: syscalls.Supported("syncfs", Syncfs), 362 307: syscalls.Supported("sendmmsg", SendMMsg), 363 308: syscalls.Supported("setns", Setns), 364 309: syscalls.Supported("getcpu", Getcpu), 365 310: syscalls.ErrorWithEvent("process_vm_readv", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/158"}), // TODO(b/260724654) 366 311: syscalls.ErrorWithEvent("process_vm_writev", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/158"}), // TODO(b/260724654) 367 312: syscalls.CapError("kcmp", linux.CAP_SYS_PTRACE, "", nil), 368 313: syscalls.CapError("finit_module", linux.CAP_SYS_MODULE, "", nil), 369 314: syscalls.ErrorWithEvent("sched_setattr", linuxerr.ENOSYS, "gVisor does not implement a scheduler.", []string{"gvisor.dev/issue/264"}), // TODO(b/118902272) 370 315: syscalls.ErrorWithEvent("sched_getattr", linuxerr.ENOSYS, "gVisor does not implement a scheduler.", []string{"gvisor.dev/issue/264"}), // TODO(b/118902272) 371 316: syscalls.Supported("renameat2", Renameat2), 372 317: syscalls.Supported("seccomp", Seccomp), 373 318: syscalls.Supported("getrandom", GetRandom), 374 319: syscalls.Supported("memfd_create", MemfdCreate), 375 320: syscalls.CapError("kexec_file_load", linux.CAP_SYS_BOOT, "", nil), 376 321: syscalls.CapError("bpf", linux.CAP_SYS_ADMIN, "", nil), 377 322: syscalls.SupportedPoint("execveat", Execveat, PointExecveat), 378 323: syscalls.ErrorWithEvent("userfaultfd", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/266"}), // TODO(b/118906345) 379 324: syscalls.PartiallySupported("membarrier", Membarrier, "Not supported on all platforms.", nil), 380 325: syscalls.PartiallySupported("mlock2", Mlock2, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 381 382 // Syscalls implemented after 325 are "backports" from versions 383 // of Linux after 4.4. 384 326: syscalls.ErrorWithEvent("copy_file_range", linuxerr.ENOSYS, "", nil), 385 327: syscalls.SupportedPoint("preadv2", Preadv2, PointPreadv2), 386 328: syscalls.SupportedPoint("pwritev2", Pwritev2, PointPwritev2), 387 329: syscalls.ErrorWithEvent("pkey_mprotect", linuxerr.ENOSYS, "", nil), 388 330: syscalls.ErrorWithEvent("pkey_alloc", linuxerr.ENOSYS, "", nil), 389 331: syscalls.ErrorWithEvent("pkey_free", linuxerr.ENOSYS, "", nil), 390 332: syscalls.Supported("statx", Statx), 391 333: syscalls.ErrorWithEvent("io_pgetevents", linuxerr.ENOSYS, "", nil), 392 334: syscalls.PartiallySupported("rseq", RSeq, "Not supported on all platforms.", nil), 393 394 // Linux skips ahead to syscall 424 to sync numbers between arches. 395 424: syscalls.ErrorWithEvent("pidfd_send_signal", linuxerr.ENOSYS, "", nil), 396 425: syscalls.PartiallySupported("io_uring_setup", IOUringSetup, "Not all flags and functionality supported.", nil), 397 426: syscalls.PartiallySupported("io_uring_enter", IOUringEnter, "Not all flags and functionality supported.", nil), 398 427: syscalls.ErrorWithEvent("io_uring_register", linuxerr.ENOSYS, "", nil), 399 428: syscalls.ErrorWithEvent("open_tree", linuxerr.ENOSYS, "", nil), 400 429: syscalls.ErrorWithEvent("move_mount", linuxerr.ENOSYS, "", nil), 401 430: syscalls.ErrorWithEvent("fsopen", linuxerr.ENOSYS, "", nil), 402 431: syscalls.ErrorWithEvent("fsconfig", linuxerr.ENOSYS, "", nil), 403 432: syscalls.ErrorWithEvent("fsmount", linuxerr.ENOSYS, "", nil), 404 433: syscalls.ErrorWithEvent("fspick", linuxerr.ENOSYS, "", nil), 405 434: syscalls.ErrorWithEvent("pidfd_open", linuxerr.ENOSYS, "", nil), 406 435: syscalls.PartiallySupported("clone3", Clone3, "Options CLONE_PIDFD, CLONE_NEWCGROUP, CLONE_INTO_CGROUP, CLONE_NEWTIME, CLONE_CLEAR_SIGHAND, CLONE_PARENT, CLONE_SYSVSEM and, SetTid are not supported.", nil), 407 436: syscalls.Supported("close_range", CloseRange), 408 439: syscalls.Supported("faccessat2", Faccessat2), 409 441: syscalls.Supported("epoll_pwait2", EpollPwait2), 410 }, 411 Emulate: map[hostarch.Addr]uintptr{ 412 0xffffffffff600000: 96, // vsyscall gettimeofday(2) 413 0xffffffffff600400: 201, // vsyscall time(2) 414 0xffffffffff600800: 309, // vsyscall getcpu(2) 415 }, 416 Missing: func(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, error) { 417 t.Kernel().EmitUnimplementedEvent(t, sysno) 418 return 0, linuxerr.ENOSYS 419 }, 420 } 421 422 // ARM64 is a table of Linux arm64 syscall API with the corresponding syscall 423 // numbers from Linux 4.4. 424 var ARM64 = &kernel.SyscallTable{ 425 OS: abi.Linux, 426 Arch: arch.ARM64, 427 Version: kernel.Version{ 428 Sysname: LinuxSysname, 429 Release: LinuxRelease, 430 Version: LinuxVersion, 431 }, 432 AuditNumber: linux.AUDIT_ARCH_AARCH64, 433 Table: map[uintptr]kernel.Syscall{ 434 0: syscalls.PartiallySupported("io_setup", IoSetup, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 435 1: syscalls.PartiallySupported("io_destroy", IoDestroy, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 436 2: syscalls.PartiallySupported("io_submit", IoSubmit, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 437 3: syscalls.PartiallySupported("io_cancel", IoCancel, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 438 4: syscalls.PartiallySupported("io_getevents", IoGetevents, "Generally supported with exceptions. User ring optimizations are not implemented.", []string{"gvisor.dev/issue/204"}), 439 5: syscalls.Supported("setxattr", SetXattr), 440 6: syscalls.Supported("lsetxattr", Lsetxattr), 441 7: syscalls.Supported("fsetxattr", Fsetxattr), 442 8: syscalls.Supported("getxattr", GetXattr), 443 9: syscalls.Supported("lgetxattr", Lgetxattr), 444 10: syscalls.Supported("fgetxattr", Fgetxattr), 445 11: syscalls.Supported("listxattr", ListXattr), 446 12: syscalls.Supported("llistxattr", Llistxattr), 447 13: syscalls.Supported("flistxattr", Flistxattr), 448 14: syscalls.Supported("removexattr", RemoveXattr), 449 15: syscalls.Supported("lremovexattr", Lremovexattr), 450 16: syscalls.Supported("fremovexattr", Fremovexattr), 451 17: syscalls.Supported("getcwd", Getcwd), 452 18: syscalls.CapError("lookup_dcookie", linux.CAP_SYS_ADMIN, "", nil), 453 19: syscalls.SupportedPoint("eventfd2", Eventfd2, PointEventfd2), 454 20: syscalls.Supported("epoll_create1", EpollCreate1), 455 21: syscalls.Supported("epoll_ctl", EpollCtl), 456 22: syscalls.Supported("epoll_pwait", EpollPwait), 457 23: syscalls.SupportedPoint("dup", Dup, PointDup), 458 24: syscalls.SupportedPoint("dup3", Dup3, PointDup3), 459 25: syscalls.SupportedPoint("fcntl", Fcntl, PointFcntl), 460 26: syscalls.PartiallySupportedPoint("inotify_init1", InotifyInit1, PointInotifyInit1, "inotify events are only available inside the sandbox.", nil), 461 27: syscalls.PartiallySupportedPoint("inotify_add_watch", InotifyAddWatch, PointInotifyAddWatch, "inotify events are only available inside the sandbox.", nil), 462 28: syscalls.PartiallySupportedPoint("inotify_rm_watch", InotifyRmWatch, PointInotifyRmWatch, "inotify events are only available inside the sandbox.", nil), 463 29: syscalls.Supported("ioctl", Ioctl), 464 30: syscalls.CapError("ioprio_set", linux.CAP_SYS_ADMIN, "", nil), // requires cap_sys_nice or cap_sys_admin (depending) 465 31: syscalls.CapError("ioprio_get", linux.CAP_SYS_ADMIN, "", nil), // requires cap_sys_nice or cap_sys_admin (depending) 466 32: syscalls.Supported("flock", Flock), 467 33: syscalls.Supported("mknodat", Mknodat), 468 34: syscalls.Supported("mkdirat", Mkdirat), 469 35: syscalls.Supported("unlinkat", Unlinkat), 470 36: syscalls.Supported("symlinkat", Symlinkat), 471 37: syscalls.Supported("linkat", Linkat), 472 38: syscalls.Supported("renameat", Renameat), 473 39: syscalls.Supported("umount2", Umount2), 474 40: syscalls.Supported("mount", Mount), 475 41: syscalls.Supported("pivot_root", PivotRoot), 476 42: syscalls.Error("nfsservctl", linuxerr.ENOSYS, "Removed after Linux 3.1.", nil), 477 43: syscalls.Supported("statfs", Statfs), 478 44: syscalls.Supported("fstatfs", Fstatfs), 479 45: syscalls.Supported("truncate", Truncate), 480 46: syscalls.Supported("ftruncate", Ftruncate), 481 47: syscalls.PartiallySupported("fallocate", Fallocate, "Not all options are supported.", nil), 482 48: syscalls.Supported("faccessat", Faccessat), 483 49: syscalls.SupportedPoint("chdir", Chdir, PointChdir), 484 50: syscalls.SupportedPoint("fchdir", Fchdir, PointFchdir), 485 51: syscalls.SupportedPoint("chroot", Chroot, PointChroot), 486 52: syscalls.Supported("fchmod", Fchmod), 487 53: syscalls.Supported("fchmodat", Fchmodat), 488 54: syscalls.Supported("fchownat", Fchownat), 489 55: syscalls.Supported("fchown", Fchown), 490 56: syscalls.SupportedPoint("openat", Openat, PointOpenat), 491 57: syscalls.SupportedPoint("close", Close, PointClose), 492 58: syscalls.CapError("vhangup", linux.CAP_SYS_TTY_CONFIG, "", nil), 493 59: syscalls.SupportedPoint("pipe2", Pipe2, PointPipe2), 494 60: syscalls.CapError("quotactl", linux.CAP_SYS_ADMIN, "", nil), // requires cap_sys_admin for most operations 495 61: syscalls.Supported("getdents64", Getdents64), 496 62: syscalls.Supported("lseek", Lseek), 497 63: syscalls.SupportedPoint("read", Read, PointRead), 498 64: syscalls.SupportedPoint("write", Write, PointWrite), 499 65: syscalls.SupportedPoint("readv", Readv, PointReadv), 500 66: syscalls.SupportedPoint("writev", Writev, PointWritev), 501 67: syscalls.SupportedPoint("pread64", Pread64, PointPread64), 502 68: syscalls.SupportedPoint("pwrite64", Pwrite64, PointPwrite64), 503 69: syscalls.SupportedPoint("preadv", Preadv, PointPreadv), 504 70: syscalls.SupportedPoint("pwritev", Pwritev, PointPwritev), 505 71: syscalls.Supported("sendfile", Sendfile), 506 72: syscalls.Supported("pselect6", Pselect6), 507 73: syscalls.Supported("ppoll", Ppoll), 508 74: syscalls.SupportedPoint("signalfd4", Signalfd4, PointSignalfd4), 509 75: syscalls.ErrorWithEvent("vmsplice", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/138"}), // TODO(b/29354098) 510 76: syscalls.Supported("splice", Splice), 511 77: syscalls.Supported("tee", Tee), 512 78: syscalls.Supported("readlinkat", Readlinkat), 513 79: syscalls.Supported("newfstatat", Newfstatat), 514 80: syscalls.Supported("fstat", Fstat), 515 81: syscalls.Supported("sync", Sync), 516 82: syscalls.Supported("fsync", Fsync), 517 83: syscalls.Supported("fdatasync", Fdatasync), 518 84: syscalls.Supported("sync_file_range", SyncFileRange), 519 85: syscalls.SupportedPoint("timerfd_create", TimerfdCreate, PointTimerfdCreate), 520 86: syscalls.SupportedPoint("timerfd_settime", TimerfdSettime, PointTimerfdSettime), 521 87: syscalls.SupportedPoint("timerfd_gettime", TimerfdGettime, PointTimerfdGettime), 522 88: syscalls.Supported("utimensat", Utimensat), 523 89: syscalls.CapError("acct", linux.CAP_SYS_PACCT, "", nil), 524 90: syscalls.Supported("capget", Capget), 525 91: syscalls.Supported("capset", Capset), 526 92: syscalls.ErrorWithEvent("personality", linuxerr.EINVAL, "Unable to change personality.", nil), 527 93: syscalls.Supported("exit", Exit), 528 94: syscalls.Supported("exit_group", ExitGroup), 529 95: syscalls.Supported("waitid", Waitid), 530 96: syscalls.Supported("set_tid_address", SetTidAddress), 531 97: syscalls.PartiallySupported("unshare", Unshare, "Mount, cgroup namespaces not supported. Network namespaces supported but must be empty.", nil), 532 98: syscalls.PartiallySupported("futex", Futex, "Robust futexes not supported.", nil), 533 99: syscalls.Supported("set_robust_list", SetRobustList), 534 100: syscalls.Supported("get_robust_list", GetRobustList), 535 101: syscalls.Supported("nanosleep", Nanosleep), 536 102: syscalls.Supported("getitimer", Getitimer), 537 103: syscalls.Supported("setitimer", Setitimer), 538 104: syscalls.CapError("kexec_load", linux.CAP_SYS_BOOT, "", nil), 539 105: syscalls.CapError("init_module", linux.CAP_SYS_MODULE, "", nil), 540 106: syscalls.CapError("delete_module", linux.CAP_SYS_MODULE, "", nil), 541 107: syscalls.Supported("timer_create", TimerCreate), 542 108: syscalls.Supported("timer_gettime", TimerGettime), 543 109: syscalls.Supported("timer_getoverrun", TimerGetoverrun), 544 110: syscalls.Supported("timer_settime", TimerSettime), 545 111: syscalls.Supported("timer_delete", TimerDelete), 546 112: syscalls.Supported("clock_settime", ClockSettime), 547 113: syscalls.Supported("clock_gettime", ClockGettime), 548 114: syscalls.Supported("clock_getres", ClockGetres), 549 115: syscalls.Supported("clock_nanosleep", ClockNanosleep), 550 116: syscalls.PartiallySupported("syslog", Syslog, "Outputs a dummy message for security reasons.", nil), 551 117: syscalls.PartiallySupported("ptrace", Ptrace, "Options PTRACE_PEEKSIGINFO, PTRACE_SECCOMP_GET_FILTER not supported.", nil), 552 118: syscalls.CapError("sched_setparam", linux.CAP_SYS_NICE, "", nil), 553 119: syscalls.PartiallySupported("sched_setscheduler", SchedSetscheduler, "Stub implementation.", nil), 554 120: syscalls.PartiallySupported("sched_getscheduler", SchedGetscheduler, "Stub implementation.", nil), 555 121: syscalls.PartiallySupported("sched_getparam", SchedGetparam, "Stub implementation.", nil), 556 122: syscalls.PartiallySupported("sched_setaffinity", SchedSetaffinity, "Stub implementation.", nil), 557 123: syscalls.PartiallySupported("sched_getaffinity", SchedGetaffinity, "Stub implementation.", nil), 558 124: syscalls.Supported("sched_yield", SchedYield), 559 125: syscalls.PartiallySupported("sched_get_priority_max", SchedGetPriorityMax, "Stub implementation.", nil), 560 126: syscalls.PartiallySupported("sched_get_priority_min", SchedGetPriorityMin, "Stub implementation.", nil), 561 127: syscalls.ErrorWithEvent("sched_rr_get_interval", linuxerr.EPERM, "", nil), 562 128: syscalls.Supported("restart_syscall", RestartSyscall), 563 129: syscalls.Supported("kill", Kill), 564 130: syscalls.Supported("tkill", Tkill), 565 131: syscalls.Supported("tgkill", Tgkill), 566 132: syscalls.Supported("sigaltstack", Sigaltstack), 567 133: syscalls.Supported("rt_sigsuspend", RtSigsuspend), 568 134: syscalls.Supported("rt_sigaction", RtSigaction), 569 135: syscalls.Supported("rt_sigprocmask", RtSigprocmask), 570 136: syscalls.Supported("rt_sigpending", RtSigpending), 571 137: syscalls.Supported("rt_sigtimedwait", RtSigtimedwait), 572 138: syscalls.Supported("rt_sigqueueinfo", RtSigqueueinfo), 573 139: syscalls.Supported("rt_sigreturn", RtSigreturn), 574 140: syscalls.PartiallySupported("setpriority", Setpriority, "Stub implementation.", nil), 575 141: syscalls.PartiallySupported("getpriority", Getpriority, "Stub implementation.", nil), 576 142: syscalls.CapError("reboot", linux.CAP_SYS_BOOT, "", nil), 577 143: syscalls.Supported("setregid", Setregid), 578 144: syscalls.SupportedPoint("setgid", Setgid, PointSetgid), 579 145: syscalls.Supported("setreuid", Setreuid), 580 146: syscalls.SupportedPoint("setuid", Setuid, PointSetuid), 581 147: syscalls.SupportedPoint("setresuid", Setresuid, PointSetresuid), 582 148: syscalls.Supported("getresuid", Getresuid), 583 149: syscalls.SupportedPoint("setresgid", Setresgid, PointSetresgid), 584 150: syscalls.Supported("getresgid", Getresgid), 585 151: syscalls.ErrorWithEvent("setfsuid", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/260"}), // TODO(b/112851702) 586 152: syscalls.ErrorWithEvent("setfsgid", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/260"}), // TODO(b/112851702) 587 153: syscalls.Supported("times", Times), 588 154: syscalls.Supported("setpgid", Setpgid), 589 155: syscalls.Supported("getpgid", Getpgid), 590 156: syscalls.Supported("getsid", Getsid), 591 157: syscalls.SupportedPoint("setsid", Setsid, PointSetsid), 592 158: syscalls.Supported("getgroups", Getgroups), 593 159: syscalls.Supported("setgroups", Setgroups), 594 160: syscalls.Supported("uname", Uname), 595 161: syscalls.Supported("sethostname", Sethostname), 596 162: syscalls.Supported("setdomainname", Setdomainname), 597 163: syscalls.Supported("getrlimit", Getrlimit), 598 164: syscalls.PartiallySupported("setrlimit", Setrlimit, "Not all rlimits are enforced.", nil), 599 165: syscalls.PartiallySupported("getrusage", Getrusage, "Fields ru_maxrss, ru_minflt, ru_majflt, ru_inblock, ru_oublock are not supported. Fields ru_utime and ru_stime have low precision.", nil), 600 166: syscalls.Supported("umask", Umask), 601 167: syscalls.PartiallySupported("prctl", Prctl, "Not all options are supported.", nil), 602 168: syscalls.Supported("getcpu", Getcpu), 603 169: syscalls.Supported("gettimeofday", Gettimeofday), 604 170: syscalls.CapError("settimeofday", linux.CAP_SYS_TIME, "", nil), 605 171: syscalls.CapError("adjtimex", linux.CAP_SYS_TIME, "", nil), 606 172: syscalls.Supported("getpid", Getpid), 607 173: syscalls.Supported("getppid", Getppid), 608 174: syscalls.Supported("getuid", Getuid), 609 175: syscalls.Supported("geteuid", Geteuid), 610 176: syscalls.Supported("getgid", Getgid), 611 177: syscalls.Supported("getegid", Getegid), 612 178: syscalls.Supported("gettid", Gettid), 613 179: syscalls.PartiallySupported("sysinfo", Sysinfo, "Fields loads, sharedram, bufferram, totalswap, freeswap, totalhigh, freehigh not supported.", nil), 614 180: syscalls.Supported("mq_open", MqOpen), 615 181: syscalls.Supported("mq_unlink", MqUnlink), 616 182: syscalls.ErrorWithEvent("mq_timedsend", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 617 183: syscalls.ErrorWithEvent("mq_timedreceive", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 618 184: syscalls.ErrorWithEvent("mq_notify", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 619 185: syscalls.ErrorWithEvent("mq_getsetattr", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/136"}), // TODO(b/29354921) 620 186: syscalls.Supported("msgget", Msgget), 621 187: syscalls.Supported("msgctl", Msgctl), 622 188: syscalls.Supported("msgrcv", Msgrcv), 623 189: syscalls.Supported("msgsnd", Msgsnd), 624 190: syscalls.Supported("semget", Semget), 625 191: syscalls.Supported("semctl", Semctl), 626 192: syscalls.Supported("semtimedop", Semtimedop), 627 193: syscalls.PartiallySupported("semop", Semop, "Option SEM_UNDO not supported.", nil), 628 194: syscalls.PartiallySupported("shmget", Shmget, "Option SHM_HUGETLB is not supported.", nil), 629 195: syscalls.PartiallySupported("shmctl", Shmctl, "Options SHM_LOCK, SHM_UNLOCK are not supported.", nil), 630 196: syscalls.PartiallySupported("shmat", Shmat, "Option SHM_RND is not supported.", nil), 631 197: syscalls.Supported("shmdt", Shmdt), 632 198: syscalls.SupportedPoint("socket", Socket, PointSocket), 633 199: syscalls.SupportedPoint("socketpair", SocketPair, PointSocketpair), 634 200: syscalls.SupportedPoint("bind", Bind, PointBind), 635 201: syscalls.Supported("listen", Listen), 636 202: syscalls.SupportedPoint("accept", Accept, PointAccept), 637 203: syscalls.SupportedPoint("connect", Connect, PointConnect), 638 204: syscalls.Supported("getsockname", GetSockName), 639 205: syscalls.Supported("getpeername", GetPeerName), 640 206: syscalls.Supported("sendto", SendTo), 641 207: syscalls.Supported("recvfrom", RecvFrom), 642 208: syscalls.Supported("setsockopt", SetSockOpt), 643 209: syscalls.Supported("getsockopt", GetSockOpt), 644 210: syscalls.Supported("shutdown", Shutdown), 645 211: syscalls.Supported("sendmsg", SendMsg), 646 212: syscalls.Supported("recvmsg", RecvMsg), 647 213: syscalls.Supported("readahead", Readahead), 648 214: syscalls.Supported("brk", Brk), 649 215: syscalls.Supported("munmap", Munmap), 650 216: syscalls.Supported("mremap", Mremap), 651 217: syscalls.Error("add_key", linuxerr.EACCES, "Not available to user.", nil), 652 218: syscalls.Error("request_key", linuxerr.EACCES, "Not available to user.", nil), 653 219: syscalls.PartiallySupported("keyctl", Keyctl, "Only supports session keyrings with zero keys in them.", nil), 654 220: syscalls.PartiallySupportedPoint("clone", Clone, PointClone, "Options CLONE_PIDFD, CLONE_NEWCGROUP, CLONE_PARENT, CLONE_NEWTIME, CLONE_CLEAR_SIGHAND, and CLONE_SYSVSEM not supported.", nil), 655 221: syscalls.SupportedPoint("execve", Execve, PointExecve), 656 222: syscalls.Supported("mmap", Mmap), 657 223: syscalls.PartiallySupported("fadvise64", Fadvise64, "Not all options are supported.", nil), 658 224: syscalls.CapError("swapon", linux.CAP_SYS_ADMIN, "", nil), 659 225: syscalls.CapError("swapoff", linux.CAP_SYS_ADMIN, "", nil), 660 226: syscalls.Supported("mprotect", Mprotect), 661 227: syscalls.PartiallySupported("msync", Msync, "Full data flush is not guaranteed at this time.", nil), 662 228: syscalls.PartiallySupported("mlock", Mlock, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 663 229: syscalls.PartiallySupported("munlock", Munlock, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 664 230: syscalls.PartiallySupported("mlockall", Mlockall, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 665 231: syscalls.PartiallySupported("munlockall", Munlockall, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 666 232: syscalls.PartiallySupported("mincore", Mincore, "Stub implementation. The sandbox does not have access to this information. Reports all mapped pages are resident.", nil), 667 233: syscalls.PartiallySupported("madvise", Madvise, "Options MADV_DONTNEED, MADV_DONTFORK are supported. Other advice is ignored.", nil), 668 234: syscalls.ErrorWithEvent("remap_file_pages", linuxerr.ENOSYS, "Deprecated since Linux 3.16.", nil), 669 235: syscalls.PartiallySupported("mbind", Mbind, "Stub implementation. Only a single NUMA node is advertised, and mempolicy is ignored accordingly, but mbind() will succeed and has effects reflected by get_mempolicy.", []string{"gvisor.dev/issue/262"}), 670 236: syscalls.PartiallySupported("get_mempolicy", GetMempolicy, "Stub implementation.", nil), 671 237: syscalls.PartiallySupported("set_mempolicy", SetMempolicy, "Stub implementation.", nil), 672 238: syscalls.CapError("migrate_pages", linux.CAP_SYS_NICE, "", nil), 673 239: syscalls.CapError("move_pages", linux.CAP_SYS_NICE, "", nil), // requires cap_sys_nice (mostly) 674 240: syscalls.Supported("rt_tgsigqueueinfo", RtTgsigqueueinfo), 675 241: syscalls.ErrorWithEvent("perf_event_open", linuxerr.ENODEV, "No support for perf counters", nil), 676 242: syscalls.SupportedPoint("accept4", Accept4, PointAccept4), 677 243: syscalls.Supported("recvmmsg", RecvMMsg), 678 260: syscalls.Supported("wait4", Wait4), 679 261: syscalls.SupportedPoint("prlimit64", Prlimit64, PointPrlimit64), 680 262: syscalls.ErrorWithEvent("fanotify_init", linuxerr.ENOSYS, "Needs CONFIG_FANOTIFY", nil), 681 263: syscalls.ErrorWithEvent("fanotify_mark", linuxerr.ENOSYS, "Needs CONFIG_FANOTIFY", nil), 682 264: syscalls.Error("name_to_handle_at", linuxerr.EOPNOTSUPP, "Not supported by gVisor filesystems", nil), 683 265: syscalls.Error("open_by_handle_at", linuxerr.EOPNOTSUPP, "Not supported by gVisor filesystems", nil), 684 266: syscalls.CapError("clock_adjtime", linux.CAP_SYS_TIME, "", nil), 685 267: syscalls.Supported("syncfs", Syncfs), 686 268: syscalls.Supported("setns", Setns), 687 269: syscalls.Supported("sendmmsg", SendMMsg), 688 270: syscalls.ErrorWithEvent("process_vm_readv", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/158"}), // TODO(b/260724654) 689 271: syscalls.ErrorWithEvent("process_vm_writev", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/158"}), // TODO(b/260724654) 690 272: syscalls.CapError("kcmp", linux.CAP_SYS_PTRACE, "", nil), 691 273: syscalls.CapError("finit_module", linux.CAP_SYS_MODULE, "", nil), 692 274: syscalls.ErrorWithEvent("sched_setattr", linuxerr.ENOSYS, "gVisor does not implement a scheduler.", []string{"gvisor.dev/issue/264"}), // TODO(b/118902272) 693 275: syscalls.ErrorWithEvent("sched_getattr", linuxerr.ENOSYS, "gVisor does not implement a scheduler.", []string{"gvisor.dev/issue/264"}), // TODO(b/118902272) 694 276: syscalls.Supported("renameat2", Renameat2), 695 277: syscalls.Supported("seccomp", Seccomp), 696 278: syscalls.Supported("getrandom", GetRandom), 697 279: syscalls.Supported("memfd_create", MemfdCreate), 698 280: syscalls.CapError("bpf", linux.CAP_SYS_ADMIN, "", nil), 699 281: syscalls.SupportedPoint("execveat", Execveat, PointExecveat), 700 282: syscalls.ErrorWithEvent("userfaultfd", linuxerr.ENOSYS, "", []string{"gvisor.dev/issue/266"}), // TODO(b/118906345) 701 283: syscalls.PartiallySupported("membarrier", Membarrier, "Not supported on all platforms.", nil), 702 284: syscalls.PartiallySupported("mlock2", Mlock2, "Stub implementation. The sandbox lacks appropriate permissions.", nil), 703 704 // Syscalls after 284 are "backports" from versions of Linux after 4.4. 705 285: syscalls.ErrorWithEvent("copy_file_range", linuxerr.ENOSYS, "", nil), 706 286: syscalls.SupportedPoint("preadv2", Preadv2, PointPreadv2), 707 287: syscalls.SupportedPoint("pwritev2", Pwritev2, PointPwritev2), 708 288: syscalls.ErrorWithEvent("pkey_mprotect", linuxerr.ENOSYS, "", nil), 709 289: syscalls.ErrorWithEvent("pkey_alloc", linuxerr.ENOSYS, "", nil), 710 290: syscalls.ErrorWithEvent("pkey_free", linuxerr.ENOSYS, "", nil), 711 291: syscalls.Supported("statx", Statx), 712 292: syscalls.ErrorWithEvent("io_pgetevents", linuxerr.ENOSYS, "", nil), 713 293: syscalls.PartiallySupported("rseq", RSeq, "Not supported on all platforms.", nil), 714 715 // Linux skips ahead to syscall 424 to sync numbers between arches. 716 424: syscalls.ErrorWithEvent("pidfd_send_signal", linuxerr.ENOSYS, "", nil), 717 425: syscalls.PartiallySupported("io_uring_setup", IOUringSetup, "Not all flags and functionality supported.", nil), 718 426: syscalls.PartiallySupported("io_uring_enter", IOUringEnter, "Not all flags and functionality supported.", nil), 719 427: syscalls.ErrorWithEvent("io_uring_register", linuxerr.ENOSYS, "", nil), 720 428: syscalls.ErrorWithEvent("open_tree", linuxerr.ENOSYS, "", nil), 721 429: syscalls.ErrorWithEvent("move_mount", linuxerr.ENOSYS, "", nil), 722 430: syscalls.ErrorWithEvent("fsopen", linuxerr.ENOSYS, "", nil), 723 431: syscalls.ErrorWithEvent("fsconfig", linuxerr.ENOSYS, "", nil), 724 432: syscalls.ErrorWithEvent("fsmount", linuxerr.ENOSYS, "", nil), 725 433: syscalls.ErrorWithEvent("fspick", linuxerr.ENOSYS, "", nil), 726 434: syscalls.ErrorWithEvent("pidfd_open", linuxerr.ENOSYS, "", nil), 727 435: syscalls.PartiallySupported("clone3", Clone3, "Options CLONE_PIDFD, CLONE_NEWCGROUP, CLONE_INTO_CGROUP, CLONE_NEWTIME, CLONE_CLEAR_SIGHAND, CLONE_PARENT, CLONE_SYSVSEM and clone_args.set_tid are not supported.", nil), 728 436: syscalls.Supported("close_range", CloseRange), 729 439: syscalls.Supported("faccessat2", Faccessat2), 730 441: syscalls.Supported("epoll_pwait2", EpollPwait2), 731 }, 732 Emulate: map[hostarch.Addr]uintptr{}, 733 Missing: func(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, error) { 734 t.Kernel().EmitUnimplementedEvent(t, sysno) 735 return 0, linuxerr.ENOSYS 736 }, 737 } 738 739 func init() { 740 kernel.RegisterSyscallTable(AMD64) 741 kernel.RegisterSyscallTable(ARM64) 742 }