summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux
AgeCommit message (Collapse)Author
2021-08-12test/pipe: use futex() for sync with the signal handerAndrei Vagin
PiperOrigin-RevId: 390399815
2021-08-12Add support for TCP send buffer auto tuning.Nayana Bidari
Send buffer size in TCP indicates the amount of bytes available for the sender to transmit. This change will allow TCP to update the send buffer size when - TCP enters established state. - ACK is received. The auto tuning is disabled when the send buffer size is set with the SO_SNDBUF option. PiperOrigin-RevId: 390312274
2021-08-11Run packet socket tests on FuchsiaGhanan Gowripalan
+ Do not check for CAP_NET_RAW on Fuchsia Fuchsia does not support capabilities the same way Linux does. Instead emulate the check for CAP_NET_RAW by checking if a packet socket may be created. Bug: https://fxbug.dev/79016, https://fxbug.dev/81592 PiperOrigin-RevId: 390263666
2021-08-11Initial cgroupfs support for subcontainersRahat Mahmood
Allow creation and management of subcontainers through cgroupfs directory syscalls. Also add a mechanism to specify a default root container to start new jobs in. This implements the filesystem support for subcontainers, but doesn't implement hierarchical resource accounting or task migration. PiperOrigin-RevId: 390254870
2021-08-11Fix FSSupportsMap checkAdam Barth
Previously, this check always failed because we did not provide MAP_SHARED or MAP_PRIVATE. PiperOrigin-RevId: 390251086
2021-08-11Wrap test queues in Queue object on creation.Rahat Mahmood
PiperOrigin-RevId: 390245901
2021-08-11Fix LinkTest.OldnameDoesNotExistAdam Barth
Previous, this test was the same as OldnameIsEmpty. This CL makes the test check what happens if the old name does not exist. PiperOrigin-RevId: 390243070
2021-08-09Run raw IP socket syscall tests on FuchsiaGhanan Gowripalan
+ Do not check for CAP_NET_RAW on Fuchsia Fuchsia does not support capabilities the same way Linux does. Instead emulate the check for CAP_NET_RAW by checking if a raw IP sockets may be created. PiperOrigin-RevId: 389663218
2021-08-05Correctly handle interruptions in blocking msgqueue syscalls.Rahat Mahmood
Reported-by: syzbot+63bde04529f701c76168@syzkaller.appspotmail.com Reported-by: syzbot+69866b9a16ec29993e6a@syzkaller.appspotmail.com PiperOrigin-RevId: 389084629
2021-08-05Replace unsafe use of fork() in msgqueue tests.Rahat Mahmood
Msgqueue tests were using fork() to run create a separate thread of execution for passing messages back and forth over a queue. However, the child process after a fork() may only use async-signal-safe functions, which at a minimum exclude gtest asserts. Instead, use threads. PiperOrigin-RevId: 389073744
2021-08-05Skip mmap test cases if underlying FS doesn't support maps.Rahat Mahmood
For file-based mmap tests, the underlying file system may not support mmaps depending on the sandbox configuration. This is case when caching is disabled for goferfs. PiperOrigin-RevId: 389052722
2021-08-04Implement PR_SET_CHILD_SUBREAPER when the calling task is PID 1.Nicolas Lacasse
In this case, the task is already a subreaper, so setting this bit is a noop. Updates #2323 PiperOrigin-RevId: 388828034
2021-08-03Use GetAbsoluteTestTmpdir() rather than hard-code "/tmp"Adam Barth
This change makes these tests easier to run on systems that have their temp directory in another location. PiperOrigin-RevId: 388601202
2021-08-03Merge pull request #6171 from sudo-sturbia:msgqueue/syscalls2gVisor bot
PiperOrigin-RevId: 388497055
2021-08-03Implement MSG_COPY option for msgrcv(2).Zyad A. Ali
Implement Queue.Copy and add more tests for it. Updates #135
2021-08-03Implement stubs for msgsnd(2) and msgrcv(2).Zyad A. Ali
Add support for msgsnd and msgrcv and enable syscall tests. Updates #135
2021-08-03Add blocking and general tests for msgsnd(2) and msgrcv(2).Zyad A. Ali
Updates #135
2021-08-03Add non-blocking tests for msgsnd(2) and msgrcv(2).Zyad A. Ali
Updates #135
2021-07-30Support RTM_DELLINKZeling Feng
This change will allow us to remove the default link in a packetimpact test so we can reduce indeterministic behaviors as required in https://fxbug.dev/78430. This will also help with testing #1388. Updates #578, #1388. PiperOrigin-RevId: 387896847
2021-07-30Merge pull request #6257 from zhlhahaha:2193-1gVisor bot
PiperOrigin-RevId: 387885663
2021-07-28Add Uid/Gid/Groups fields to VFS2 /proc/[pid]/status.Jamie Liu
For comparison: ``` $ docker run --rm -it ubuntu:focal bash -c 'cat /proc/self/status' Name: cat Umask: 0022 State: R (running) Tgid: 1 Ngid: 0 Pid: 1 PPid: 0 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 FDSize: 64 Groups: NStgid: 1 NSpid: 1 NSpgid: 1 NSsid: 1 VmPeak: 2660 kB VmSize: 2660 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 528 kB VmRSS: 528 kB ... $ docker run --runtime=runsc-vfs2 --rm -it ubuntu:focal bash -c 'cat /proc/self/status' Name: cat State: R (running) Tgid: 1 Pid: 1 PPid: 0 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 FDSize: 4 Groups: VmSize: 10708 kB VmRSS: 3124 kB VmData: 316 kB ... ``` Fixes #6374 PiperOrigin-RevId: 387465655
2021-07-27Don't create an extra fd bitmap to allocate a new fd.Andrei Vagin
2021-07-23Add verity open benchmark testChong Cai
PiperOrigin-RevId: 386533065
2021-07-23Don't panic on user-controlled state in semaphore syscalls.Rahat Mahmood
Reported-by: syzbot+beb099a67f670386a367@syzkaller.appspotmail.com PiperOrigin-RevId: 386521361
2021-07-23update bug number in loopback testsKevin Krakauer
PiperOrigin-RevId: 386511209
2021-07-23buildkite: deflake itimer testKevin Krakauer
The self-admittedly arbitrary threshold of 20% of alarms being sent to the main thread was being breached. I saw a run of of ~20-23% [1]. We should allow for a little more breathing room. 1 - https://buildkite.com/gvisor/pipeline/builds/7400 PiperOrigin-RevId: 386503482
2021-07-22Move socket_test_util to //test/utilGhanan Gowripalan
...and rename the library to socket_util. PiperOrigin-RevId: 386348306
2021-07-22Merge pull request #6108 from sudo-sturbia:msgqueue/syscallsgVisor bot
PiperOrigin-RevId: 386323389
2021-07-20Enable RACK by default in netstack.Nayana Bidari
PiperOrigin-RevId: 385944428
2021-07-20Expose local address from raw socketsGhanan Gowripalan
PiperOrigin-RevId: 385940836
2021-07-15netstack: support SO_RCVBUFFORCEKevin Krakauer
TCP is fully supported. As with SO_RCVBUF, other transport protocols perform no-ops per DefaultSocketOptionsHandler.OnSetReceiveBufferSize. PiperOrigin-RevId: 385023239
2021-07-14Add verity symlink testsChong Cai
PiperOrigin-RevId: 384823097
2021-07-14testing: shrink exhaustion test size to avoid timeoutsKevin Krakauer
Tested via: ``` bazel test \ //test/syscalls:socket_ipv4_udp_unbound_loopback_nogotsan_test_runsc_ptrace --runs_per_test=2000 ``` PiperOrigin-RevId: 384773477
2021-07-13Implement stubs for msgget(2) and msgctl(IPC_RMID).Zyad A. Ali
Add support for msgget, and msgctl(IPC_RMID), and enable msgqueue syscall tests. Updates #135
2021-07-13Add initial test cases for msgget(2).Zyad A. Ali
Updates #135
2021-07-12Fix async-signal-unsafety in chroot test.Jamie Liu
PiperOrigin-RevId: 384295543
2021-07-08Fix async-signal-unsafety in socket test.Jamie Liu
PiperOrigin-RevId: 383689096
2021-07-02[op] Make TCPNonBlockingConnectClose more reasonable.Ayush Ranjan
This test single handedly causes the syscalls:socket_inet_loopback_test test variants to take more than an hour to run on some of our testing environments. Reduce how aggressively this test tries to replicate a fixed flake. This is a regression test. PiperOrigin-RevId: 382849039
2021-07-01Fix bug with TCP bind w/ SO_REUSEADDR.Bhasker Hariharan
In gVisor today its possible that when trying to bind a TCP socket w/ SO_REUSEADDR specified and requesting the kernel pick a port by setting port to zero can result in a previously bound port being returned. This behaviour is incorrect as the user is clearly requesting a free port. The behaviour is fine when the user explicity specifies a port. This change now checks if the user specified a port when making a port reservation for a TCP port and only returns unbound ports even if SO_REUSEADDR was specified. Fixes #6209 PiperOrigin-RevId: 382607638
2021-06-29Merge pull request #6085 from liornm:fix-tun-no_pigVisor bot
PiperOrigin-RevId: 382202462
2021-06-29Add SIOCGIFFLAGS ioctl support to hostinet.Lucas Manning
PiperOrigin-RevId: 382194711
2021-06-29Fix TUN IFF_NO_PI bugliornm
When TUN is created with IFF_NO_PI flag, there will be no Ethernet header and no packet info, therefore, both read and write will fail. This commit fix this bug.
2021-06-28code quality: cleanup lint messagesKevin Krakauer
dns PiperOrigin-RevId: 381949375
2021-06-28check explicitly that AF_PACKET sockets can't write in gVisorKevin Krakauer
PiperOrigin-RevId: 381896875
2021-06-24Run `:socket_inet_loopback_isolated_test_linux` tests in a container.Etienne Perot
This creates new user and network namespaces for all tests in `:socket_inet_loopback_isolated_test_linux`. PiperOrigin-RevId: 381374120
2021-06-23Fix PR_SET_PTRACER applicability to non-leader threads.Jamie Liu
Compare if (!thread_group_leader(tracee)) tracee = rcu_dereference(tracee->group_leader); in security/yama/yama_lsm.c:ptracer_exception_found(). PiperOrigin-RevId: 381074242
2021-06-22Wake up Writers when tcp socket is shutdown for writes.Bhasker Hariharan
PiperOrigin-RevId: 380967023
2021-06-22`socket_inet_loopback`: Split off tests that need isolation in their own file.Etienne Perot
This allows these tests, which can cause flakiness when run in the same network namespace as the other `socket_inet_loopback` tests, to run as separate tests in their own environment. It also means that all of the shards of those tests can be more isolated from each other as well. PiperOrigin-RevId: 380930198
2021-06-22Trigger poll/epoll events on zero-length hostinet sendmsgIan Lewis
Fixes #2726 PiperOrigin-RevId: 380753516
2021-06-21clean up tcpdump TODOsKevin Krakauer
tcpdump is largely supported. We've also chose not to implement writeable AF_PACKET sockets, and there's a bug specifically for promiscuous mode (#3333). Fixes #173. PiperOrigin-RevId: 380733686