summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux
AgeCommit message (Collapse)Author
2020-01-21Add syscalls for lgetxattr, fgetxattr, lsetxattr, and fsetxattr.Dean Deng
Note that these simply will use the same logic as getxattr and setxattr, which is not yet implemented for most filesystems. PiperOrigin-RevId: 290800960
2020-01-21Merge pull request #1546 from lubinszARM:pr_syscall_test_procgVisor bot
PiperOrigin-RevId: 290789087
2020-01-17Convert EventMask to uint64Andrei Vagin
It is used for signalfd where the maximum signal is 64. PiperOrigin-RevId: 290331008
2020-01-16Disable xattr tests.Dean Deng
These can remain disabled until we actually support extended attributes. The following modifications were also made: 1. Disable save/restore on tests that change file permissions. Restore will not work properly for these tests, since it will try to open the file with read-write after it has been read- or write-only. 2. Change user.abc to user.test. PiperOrigin-RevId: 290123941
2020-01-14Changes TCP packet dispatch to use a pool of goroutines.Bhasker Hariharan
All inbound segments for connections in ESTABLISHED state are delivered to the endpoint's queue but for every segment delivered we also queue the endpoint for processing to a selected processor. This ensures that when there are a large number of connections in ESTABLISHED state the inbound packets are all handled by a small number of goroutines and significantly reduces the amount of work the goscheduler has to perform. We let connections in other states follow the current path where the endpoint's goroutine directly handles the segments. Updates #231 PiperOrigin-RevId: 289728325
2020-01-14Implement {g,s}etsockopt(IP_RECVTOS) for UDP socketsTamir Duberstein
PiperOrigin-RevId: 289718534
2020-01-13Allow dual stack sockets to operate on AF_INETTamir Duberstein
Fixes #1490 Fixes #1495 PiperOrigin-RevId: 289523250
2020-01-13tests: fix errors detected by asan.Andrei Vagin
PiperOrigin-RevId: 289467083
2020-01-10Don't set RWF_HIPRI on InvalidOffset test.Brad Burlage
This test fails on ubuntu 18.04 because preadv2 for some reason returns EOPNOTSUPP instead of EINVAL. Instead of root-causing the failure, I'm dropping the flag in the preadv2 call since it isn't under test in this scenario. PiperOrigin-RevId: 289188358
2020-01-10enable //test/syscalls:proc_test support on Arm64Bin Lu
Problems with different platform architectures have been solved. Signed-off-by: Bin Lu <bin.lu@arm.com>
2020-01-09Deflake a couple of TCP syscall tests when run under gotsan.Bhasker Hariharan
PiperOrigin-RevId: 289010316
2020-01-08Return correct length with MSG_TRUNC for unix sockets.Ian Lewis
This change calls a new Truncate method on the EndpointReader in RecvMsg for both netlink and unix sockets. This allows readers such as sockets to peek at the length of data without actually reading it to a buffer. Fixes #993 #1240 PiperOrigin-RevId: 288800167
2020-01-08Fix slice bounds out of range panic in parsing socket control message.Ting-Yu Wang
Panic found by syzakller. PiperOrigin-RevId: 288799046
2020-01-08Take addresses as constTamir Duberstein
PiperOrigin-RevId: 288767927
2020-01-07fs/splice: don't report a partialResult error if there is no data lossAndrei Vagin
PiperOrigin-RevId: 288642552
2020-01-07Fix partial_bad_buffer write tests.Adin Scannell
The write tests are fitted to Linux-specific behavior, but it is not well-specified. Tweak the tests to allow for both acceptable outcomes. PiperOrigin-RevId: 288606386
2019-12-26Automated rollback of changelist 287029703gVisor bot
PiperOrigin-RevId: 287217899
2019-12-24Enable IP_RECVTOS socket option for datagram socketsRyan Heacock
Added the ability to get/set the IP_RECVTOS socket option on UDP endpoints. If enabled, TOS from the incoming Network Header passed as ancillary data in the ControlMessages. Test: * Added unit test to udp_test.go that tests getting/setting as well as verifying that we receive expected TOS from incoming packet. * Added a syscall test PiperOrigin-RevId: 287029703
2019-12-19futex: wake one waiter if futex_wake is called with a non-positive valueAndrei Vagin
This change is needed to be compatible with the Linux kernel. There is no glibc wrapper for the futex system call, so it is easy to make a mistake and call syscall(__NR_futex, FUTEX_WAKE, addr) without the fourth argument. This works on Linux, because it wakes one waiter even if val is nonpositive. PiperOrigin-RevId: 286494396
2019-12-19Parameterize mmap tests.Dean Deng
This test suite has existed for quite a while and has become kind of messy. Various tests can be joined together by parameterizing. PiperOrigin-RevId: 286482240
2019-12-18net/tcp: allow to call listen without bindAndrei Vagin
When listen(2) is called on an unbound socket, the socket is automatically bound to a random free port with the local address set to INADDR_ANY. PiperOrigin-RevId: 286305906
2019-12-18Switch to netinet/tcp.h and poll.h to for better platform portability.Jay Zhuang
PiperOrigin-RevId: 286249699
2019-12-18Put GetSocketPairs() in unnamed namespaceJay Zhuang
This avoids conflicting definitions of GetSocketPairs() in outer namespace when multiple such cc files are complied for one binary. PiperOrigin-RevId: 286243045
2019-12-17Internal change.gVisor bot
PiperOrigin-RevId: 286003946
2019-12-17Explicitly export files needed by other packagesgVisor bot
PiperOrigin-RevId: 285968611
2019-12-16Implement checks for get/setxattr at the syscall layer.Dean Deng
Add checks for input arguments, file type, permissions, etc. that match the Linux implementation. A call to get/setxattr that passes all the checks will still currently return EOPNOTSUPP. Actual support will be added in following commits. Only allow user.* extended attributes for the time being. PiperOrigin-RevId: 285835159
2019-12-12unix: allow to bind unix sockets only to AF_UNIX addressesAndrei Vagin
Reported-by: syzbot+2c0bcfd87fb4e8b7b009@syzkaller.appspotmail.com PiperOrigin-RevId: 285228312
2019-12-11Add support for TCP_USER_TIMEOUT option.Bhasker Hariharan
The implementation follows the linux behavior where specifying a TCP_USER_TIMEOUT will cause the resend timer to honor the user specified timeout rather than the default rto based timeout. Further it alters when connections are timedout due to keepalive failures. It does not alter the behavior of when keepalives are sent. This is as per the linux behavior. PiperOrigin-RevId: 285099795
2019-12-11Add syscall tests for getxattr and setxattr.Dean Deng
Support for getxattr and setxattr are in subsequent commits. PiperOrigin-RevId: 285088817
2019-12-10Re-enable execveat test that was causing files in /bin to be deleted.Dean Deng
Test now no longer deletes files incorrectly, due to a fix in fs utils used by TempPath (github.com/google/gvisor/pull/1368). Fixes #1366 PiperOrigin-RevId: 284814605
2019-12-10Disable execveat test that is causing files in /bin to be deleted.Dean Deng
Disable until gvisor.dev/issue/1366 is resolved. Updates #1366 PiperOrigin-RevId: 284786895
2019-12-10Add hostinet tests for sendmsg and recvmsg with TOS/TCLASS.Dean Deng
PiperOrigin-RevId: 284786069
2019-12-09Add test for SO_BINDTODEVICE state bug.Ian Gudger
This was accidentally dropped from the change which fixed the bug. Updates #1217 PiperOrigin-RevId: 284689362
2019-12-09Add UDP SO_REUSEADDR support to the port manager.Ian Gudger
Next steps include adding support to the transport demuxer and the UDP endpoint. PiperOrigin-RevId: 284652151
2019-12-09Include <netinet/tcp.h> for TCP enums in proc_net testsJay Zhuang
These are currently duplicated in ip_socket_test_util, so tests including both netinet/tcp.h and ip_socket_test_util won't compile. PiperOrigin-RevId: 284623958
2019-12-09Mark test as non flaky.Bhasker Hariharan
PiperOrigin-RevId: 284606133
2019-12-09Add tests for rseq(2)Michael Pratt
Add a decent set of syscall tests for rseq(2). These are a bit awkward because of issues with library integration. libc may register rseq on thread start (including before main on the initial thread), precluding much testing. Thus we run tests in a libc-free subprocess. Support for rseq(2) in gVisor will come in a later commit. PiperOrigin-RevId: 284595994
2019-12-06Add hostinet tests for UDP sockets.Dean Deng
We need to skip a subset of the tests, because of features that hostinet does not currently support. Fixes #1209 PiperOrigin-RevId: 284235911
2019-12-05Implement F_GETOWN_EX and F_SETOWN_EX.Ian Gudger
Some versions of glibc will convert F_GETOWN fcntl(2) calls into F_GETOWN_EX in some cases. PiperOrigin-RevId: 284089373
2019-12-05Reduce flakiness under gotsan runs.Bhasker Hariharan
TcpPortReuseMultiThread creates lots of connections which result in a lot of goroutines in the sentry. This can cause gotsan runs to take really long and timeout. Increasing listen backlog and reducing number of connections should help the connections complete faster as well as reduce the number of goroutines that gotsan needs to track. PiperOrigin-RevId: 284046018
2019-12-05Create correct file for /proc/[pid]/task/[tid]/ioZach Koopmans
PiperOrigin-RevId: 284038840
2019-12-05Explicitly export files needed by other packagesgVisor bot
PiperOrigin-RevId: 283955946
2019-12-03Clean up readv_socket test suite.Dean Deng
Get rid of the SocketTest class, which is only extended by ReadvSocketTest. Also, get rid of TCP sockets (which were unused anyway) from readv_socket.cc. This is a very old test suite that isn't the right place for TCP loopback tests. PiperOrigin-RevId: 283672772
2019-12-03Point TODO to gvisor.devFabricio Voznika
PiperOrigin-RevId: 283657725
2019-12-03net/udp: return a local route address as the bound-to addressAndrei Vagin
If the socket is bound to ANY and connected to a loopback address, getsockname() has to return the loopback address. Without this fix, getsockname() returns ANY. PiperOrigin-RevId: 283647781
2019-12-03Fix panic due to early transition to Closed.Bhasker Hariharan
The code in rcv.consumeSegment incorrectly transitions to CLOSED state from LAST-ACK before the final ACK for the FIN. Further if receiving a segment changes a socket to a closed state then we should not invoke the sender as the socket is now closed and sending any segments is incorrect. PiperOrigin-RevId: 283625300
2019-12-03strace: don't create a slice with a negative valueAndrei Vagin
PiperOrigin-RevId: 283613824
2019-12-03Add RunfilesPath to test_utilMichael Pratt
A few tests have their own ad-hoc implementations. Add a single common one. PiperOrigin-RevId: 283601666
2019-12-02test/syscal: Don't skip ClockGettime.CputimeIdAndrei Vagin
We skipped it due to the issue in the golang scheduler which has been fixed in go1.13. PiperOrigin-RevId: 283432226
2019-12-02Fix typo, s/Convertable/Convertible/gJay Zhuang
PiperOrigin-RevId: 283345791