Commit Graph
83 Commits
Author SHA1 Message Date
Shambhavi SrivastavaandgVisor bot 884e65cf41 Automated rollback of changelist 557871250
PiperOrigin-RevId: 560158129
2023-08-25 11:58:29 -07:00
Nicolas LacasseandgVisor bot 5dc1f9fa34 Automated rollback of changelist 554554034
PiperOrigin-RevId: 557871250
2023-08-17 10:50:10 -07:00
Shambhavi SrivastavaandgVisor bot f75fcdfa83 Implementing clone3
Updates #8585

PiperOrigin-RevId: 554554034
2023-08-07 12:19:32 -07:00
Andrei VaginandgVisor bot c5493106c6 Implement the setns syscall
This change introduces the nsfs file system. Each new namespace allocates
a new nsfs inode.

Here are reasons why we need these inodes:
* each namespace has to have an unique id.
* proc/pid/ns/ contains one entry for each namespace. Bind mounting one of
  the files in this directory to somewhere else in the filesystem keeps the
  corresponding namespace alive even if all processes currently in
  the namespace terminate.
* setns() allows the calling process to join an existing namespace specified
  by a file descriptor.

PiperOrigin-RevId: 550694515
2023-07-24 15:45:08 -07:00
Etienne PerotandgVisor bot da6948a692 gVisor: Refactor SyscallFn to take in the syscall number as argument.
This will be used to plumb the syscall number through to a counter metric that
exports the number of times an unimplemented syscall has been called.

Plenty of syscall implementations call `EmitUnimplementedEvent` for flags and
settings that are not implemented. With `sysno` available, they will be able
to plumb that bit of information through.

PiperOrigin-RevId: 518635831
2023-03-22 12:06:26 -07:00
Konstantin BogomolovandgVisor bot 0416d0a2d3 Add TESTONLY sentry panic trigger through afs_syscall.
This flag is added for tests that need to trigger a panic in the sentry
kernel. Only done for x86_64 which does have a dedicated syscall number for
afs_syscall; ARM does not.

PiperOrigin-RevId: 512731631
2023-02-27 14:28:30 -08:00
Fabricio VoznikaandgVisor bot 4d3d2741d3 Rename pselect to pselect6
The actual syscall name is pselect6. This name is used in Docker's
default seccomp profile.

PiperOrigin-RevId: 503297316
2023-01-19 16:38:48 -08:00
Zach KoopmansandgVisor bot c7dc8294b3 Disable process_vm_(read|write)v.
Syzkaller has found several issues with the two syscalls and a rework is
required. Disable tests and the syscall until issues can be fixed.

PiperOrigin-RevId: 491716795
2022-11-29 13:14:29 -08:00
Zach KoopmansandgVisor bot abe3813b7f Re-enable process_vm_(read|write)v
PiperOrigin-RevId: 489298284
2022-11-17 13:50:43 -08:00
Fabricio VoznikaandgVisor bot 22de242ebf Add read/write syscalls to trace points
Closes #8092

PiperOrigin-RevId: 488719448
2022-11-15 11:54:23 -08:00
Ayush RanjanandgVisor bot d90d0743d3 Delete VFS1 syscall handlers.
Directly use VFS2 syscall handlers. No need to override VFS2 handlers.
Updates #1624

PiperOrigin-RevId: 488448348
2022-11-14 13:11:22 -08:00
Shambhavi SrivastavaandgVisor bot b160b2ad2a Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

  - timerfd_create
  - timerfd_settime
  - timerfd_gettime
  - fork, vfork
  - inotify_init, inotify_init1
  - inotify_add_watch
  - inotify_rm_watch
  - socketpair

Updates #4805

PiperOrigin-RevId: 459596784
2022-07-07 14:10:36 -07:00
Shambhavi SrivastavaandgVisor bot 6a894725e6 Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

  - chroot
  - dup, dup2, dup3
  - prlimit64
  - eventfd, eventfd2
  - signalfd, signalfd4
  - bind
  - accept, accept4
  - fcntl
  - pipe, pipe2

Updates #4805

PiperOrigin-RevId: 457139504
2022-06-24 19:37:41 -07:00
Shambhavi SrivastavaandgVisor bot 2adbcf780f Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

- Chdir
- Fchdir
- Setgid
- Setuid
- Setsid
- Setresuid
- Setresgid

PiperOrigin-RevId: 451001973
2022-05-25 13:34:03 -07:00
Fabricio VoznikaandgVisor bot 974fc32a4d Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

  - read
  - close
  - socket
  - connect
  - execve
  - creat
  - openat
  - execveat

Updates #4805

PiperOrigin-RevId: 446008358
2022-05-02 13:03:04 -07:00
Konstantin BogomolovandgVisor bot 03113543e2 Implement close_range.
Fixes #5500

PiperOrigin-RevId: 431454836
2022-02-28 09:37:03 -08:00
gVisor bot d3db71d3b1 Merge pull request #6262 from sudo-sturbia:msgqueue/syscalls3
PiperOrigin-RevId: 391416650
2021-08-17 17:44:26 -07:00
Zyad A. Ali 4ba2317532 Implement stub for msgctl(2).
Add support for msgctl and enable tests.

Fixes #135
2021-08-17 20:34:51 +02:00
Zach KoopmansandgVisor bot f26a93e634 [syserror] Convert remaining syserror definitions to linuxerr.
Convert remaining public errors (e.g. EINTR) from syserror to linuxerr.

PiperOrigin-RevId: 390471763
2021-08-12 15:19:12 -07:00
Zyad A. Ali f517422db2 Implement MSG_COPY option for msgrcv(2).
Implement Queue.Copy and add more tests for it.

Updates #135
2021-08-03 18:13:24 +02:00
Zyad A. Ali 5eb71ba8ed Implement stubs for msgsnd(2) and msgrcv(2).
Add support for msgsnd and msgrcv and enable syscall tests.

Updates #135
2021-08-03 18:13:24 +02:00
Zyad A. Ali 0683ff858f Implement stubs for msgget(2) and msgctl(IPC_RMID).
Add support for msgget, and msgctl(IPC_RMID), and enable msgqueue
syscall tests.

Updates #135
2021-07-13 22:12:02 +02:00
Zach KoopmansandgVisor bot 5e6d494c2f [syserror] Update syserror to linuxerr for more errors.
Update the following from syserror to the linuxerr equivalent:
EEXIST
EFAULT
ENOTDIR
ENOTTY
EOPNOTSUPP
ERANGE
ESRCH

PiperOrigin-RevId: 384329869
2021-07-12 15:26:20 -07:00
Zach KoopmansandgVisor bot f033577349 [syserror] Update several syserror errors to linuxerr equivalents.
Update/remove most syserror errors to linuxerr equivalents. For list
of removed errors, see //pkg/syserror/syserror.go.

PiperOrigin-RevId: 382574582
2021-07-01 12:05:19 -07:00
Zach KoopmansandgVisor bot 895c2eaa09 [syserror] Update syserror to linuxerr for EACCES, EBADF, and EPERM.
Update all instances of the above errors to the faster linuxerr implementation.
With the temporary linuxerr.Equals(), no logical changes are made.

PiperOrigin-RevId: 382306655
2021-06-30 08:18:59 -07:00
Zach KoopmansandgVisor bot cd84634cc0 [syserror] Change syserror to linuxerr for E2BIG, EADDRINUSE, and EINVAL
Remove three syserror entries duplicated in linuxerr. Because of the
linuxerr.Equals method, this is a mere change of return values from
syserror to linuxerr definitions.

Done with only these three errnos as CLs removing all grow to a significantly
large size.

PiperOrigin-RevId: 382173835
2021-06-29 15:08:46 -07:00
Jing ChenandgVisor bot 28e936f008 Implement epoll_pwait2.
PiperOrigin-RevId: 371216407
2021-04-29 15:22:09 -07:00
Zach KoopmansandgVisor bot d8f34027b3 [syserror] Split usermem package
Split usermem package to help remove syserror dependency in go_marshal.
New hostarch package contains code not dependent on syserror.

PiperOrigin-RevId: 365651233
2021-03-29 13:30:21 -07:00
Jing ChenandgVisor bot cf7760fff5 Implement SEM_STAT_ANY cmd of semctl.
PiperOrigin-RevId: 359591577
2021-02-25 12:57:01 -08:00
Jing ChenandgVisor bot 6ddc384243 Implement semtimedop.
PiperOrigin-RevId: 357031904
2021-02-11 12:21:59 -08:00
Dean DengandgVisor bot a844bca66a Update splice syscall documentation.
PiperOrigin-RevId: 352954044
2021-01-20 23:39:37 -08:00
Andrei Vagin 136da4e386 Implement the semtimedop syscall
Signed-off-by: Andrei Vagin <[email protected]>
2021-01-07 11:49:40 -08:00
Jing ChenandgVisor bot 070e277b6e Implement command SEM_INFO and SEM_STAT for semctl.
PiperOrigin-RevId: 347711998
2020-12-15 16:06:06 -08:00
Jing ChenandgVisor bot 9b1bf422a0 Implement command IPC_INFO for semctl.
PiperOrigin-RevId: 345589628
2020-12-03 19:57:51 -08:00
Jing ChenandgVisor bot 56ccd9aad9 Implement command GETNCNT for semctl.
PiperOrigin-RevId: 341154192
2020-11-06 18:38:13 -08:00
Jing ChenandgVisor bot 3e67015622 Implement command GETZCNT for semctl.
PiperOrigin-RevId: 340389884
2020-11-02 23:58:45 -08:00
Jing ChenandgVisor bot faa7abcddb Implement command IPC_STAT for semctl.
PiperOrigin-RevId: 339166854
2020-10-26 19:26:42 -07:00
Jamie LiuandgVisor bot a67a9e3181 Implement membarrier(2) commands other than *_SYNC_CORE.
Updates #267

PiperOrigin-RevId: 335713923
2020-10-06 13:55:16 -07:00
Bin Lu 55e2bc67d1 arm64: some minor changes
This patch adds minor changes for Arm64 platform:
  1, add SetRobustList/GetRobustList support for arm64 syscall module.
  2, add newfstatat support for arm64 vfs2 syscall module.
  3, add tls value in ProtoBuf.

Signed-off-by: Bin Lu <[email protected]>
2020-09-25 03:32:57 -04:00
Fabricio VoznikaandgVisor bot 9746c5d824 Add note about gofer link(2) limitation
PiperOrigin-RevId: 331648296
2020-09-14 16:05:02 -07:00
Dean DengandgVisor bot 65087ae86a Update inotify documentation for gofer filesystem.
We now allow hard links to be created within gofer fs (see
github.com/google/gvisor/commit/4433196d8397c0d9a9ecaa37a28e79254a603048).
Update the inotify documentation accordingly.

PiperOrigin-RevId: 328177485
2020-08-24 11:30:44 -07:00
Nicolas LacasseandgVisor bot 86dc46113e Implement get/set_robust_list.
PiperOrigin-RevId: 322904430
2020-07-23 17:42:50 -07:00
Adin ScannellandgVisor bot d123c8e75a Fix runsc syscall documentation generation.
We can register any number of tables with any number of architectures, and
need not limit the definitions to the architecture in question. This allows
runsc to generate documentation for all architectures simultaneously.

Similarly, this simplifies the VFSv2 patching process.

PiperOrigin-RevId: 310224827
2020-05-06 14:13:48 -07:00
Ian LewisandgVisor bot ac13cf3d61 Update const names to be Go style.
PiperOrigin-RevId: 276165962
2019-10-22 16:16:41 -07:00
Michael PrattandgVisor bot 024927478f Add sublevel to kernel version
Standard Linux kernel versions are VERSION.PATCHLEVEL.SUBLEVEL. e.g., 4.4.0,
even when the sublevel is 0. Match this standard.

PiperOrigin-RevId: 275125715
2019-10-16 15:22:42 -07:00
gVisor bot 5d7f68b5d9 Merge pull request #753 from lubinszARM:pr_syscall_linux
PiperOrigin-RevId: 273364848
2019-10-07 13:52:19 -07:00
Andrei VaginandGitHub 4c521901d6 Merge branch 'master' into pr_syscall_linux 2019-10-02 13:00:07 -07:00
Adin ScannellandgVisor bot d0f467ecd4 Stub out readahead implementation.
Closes #261

PiperOrigin-RevId: 270973347
2019-09-24 13:29:46 -07:00
Adin ScannellandgVisor bot a9318928da Signalfd support
Note that the exact semantics for these signalfds are slightly different from
Linux. These signalfds are bound to the process at creation time. Reads, polls,
etc. are all associated with signals directed at that task. In Linux, all
signalfd operations are associated with current, regardless of where the
signalfd originated.

In practice, this should not be an issue given how signalfds are used. In order
to fix this however, we will need to plumb the context through all the event
APIs. This gets complicated really quickly, because the waiter APIs are all
netstack-specific, and not generally exposed to the context.  Probably not
worthwhile fixing immediately.

PiperOrigin-RevId: 269901749
2019-09-18 15:16:42 -07:00
Bin Lu 1055c8dcf0 enable syscalls/linux to support arm64
Signed-off-by: Bin Lu <[email protected]>
Change-Id: I45af8a54304f8bb0e248ab15f4e20b173ea9e430
2019-09-18 10:13:06 +00:00