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