Commit Graph

467 Commits

Author SHA1 Message Date
Ting-Yu Wang ea5b8e9633 Use if_nametoindex to get interface index.
Removed the TODO to use netlink.

PiperOrigin-RevId: 306721468
2020-04-15 14:31:36 -07:00
Mithun Iyer 9c918340e4 Reset pending connections on listener close
Attempt to redeliver TCP segments that are enqueued into a closing
TCP endpoint. This was being done for Established endpoints but not
for those that are listening or performing connection handshake.

Fixes #2417

PiperOrigin-RevId: 306598155
2020-04-15 01:11:44 -07:00
gVisor bot 82530e4c30 Merge pull request #2375 from lubinszARM:pr_exec_binary
PiperOrigin-RevId: 306432289
2020-04-14 07:12:06 -07:00
Nicolas Lacasse 71e6ac3e1f Don't allow read/write when offset+size overflows.
PiperOrigin-RevId: 306348346
2020-04-13 18:00:17 -07:00
Tamir Duberstein d303684d7a Remove unnecessary threads
The work being done in these threads is not asynchronous with respect to
the test; that is, it is equivalent to issue non-blocking `connect`
calls serially, since the work is done asynchronously with respect to
the caller. Futhermore, this test was added to test closing a listener
with completed but not delivered connections, which never required
threading in the first place.

PiperOrigin-RevId: 306339486
2020-04-13 17:00:51 -07:00
gVisor bot 7e5d67ee90 Merge pull request #2168 from xiaobo55x:ptrace_test
PiperOrigin-RevId: 306306809
2020-04-13 14:17:53 -07:00
gVisor bot 3f4e826fb3 Merge pull request #2288 from xiaobo55x:fork_test
PiperOrigin-RevId: 306306494
2020-04-13 14:13:28 -07:00
gVisor bot 7ec2397235 Merge pull request #2289 from xiaobo55x:syscall_cleanup
PiperOrigin-RevId: 306303148
2020-04-13 13:57:23 -07:00
Dean Deng 09ddb5a426 Port extended attributes to VFS2.
As in VFS1, we only support the user.* namespace. Plumbing is added to tmpfs
and goferfs.
Note that because of the slightly different order of checks between VFS2 and
Linux, one of the xattr tests needs to be relaxed slightly.

Fixes #2363.

PiperOrigin-RevId: 305985121
2020-04-10 19:02:55 -07:00
Andrei Vagin 935007937c test: remove 1s delay after non-blocking socket pair accept
It was added in cl/201419897 to deflake
socket_ip_tcp_loopback_non_blocking_test_gvisor.
It seems we don't need this hack, because the origin issue isn't
reproducible without this hack.

PiperOrigin-RevId: 305871748
2020-04-10 07:14:35 -07:00
Haibo Xu 7aa5caae71 Enable syscall ptrace test on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I5bb8fa7d580d173b1438d6465e1adb442216c8fa
2020-04-10 10:00:26 +08:00
Haibo Xu 35e6b6bf1a Enable syscall fork_test on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I033692bcf4f8139df29e369a12b150d10fccbe32
2020-04-10 09:39:50 +08:00
Fabricio Voznika 9f87502b46 Remove TODOs from Async IO
Block and drain requests in io_destroy(2).
Note the reason to create read-only mapping.

PiperOrigin-RevId: 305786312
2020-04-09 16:41:27 -07:00
Ting-Yu Wang ace90f823c Make some functions in IfAddrHelper const.
PiperOrigin-RevId: 305782490
2020-04-09 16:22:02 -07:00
Ting-Yu Wang 64c2b49067 Dedup netlink utility functions in tests.
PiperOrigin-RevId: 305749697
2020-04-09 13:34:31 -07:00
Andrei Vagin a10389e783 splice: cap splice calls to MAX_RW_COUNT
The Linux does the same.

Reported-by: syzbot+e81716e8956e92e9d56b@syzkaller.appspotmail.com
PiperOrigin-RevId: 305625439
2020-04-08 23:03:12 -07:00
Jamie Liu 7297fd7238 Bump proc_test's kRSSTolerance to 10MB.
PiperOrigin-RevId: 305604557
2020-04-08 19:41:43 -07:00
Fabricio Voznika 6dd5a1f3fe Clean up TODOs
PiperOrigin-RevId: 305592245
2020-04-08 17:58:13 -07:00
Dean Deng 357f136e42 Handle utimes correctly for shared gofer filesystems.
Determine system time from within the sentry rather than relying on the remote
filesystem to prevent inconsistencies.
Resolve related TODOs; the time discrepancies in question don't exist anymore.

PiperOrigin-RevId: 305557099
2020-04-08 14:39:25 -07:00
Ting-Yu Wang 2907e6da5e file test: Remove FIXME about FIFO. It is already tested in mknod test.
PiperOrigin-RevId: 305546584
2020-04-08 13:48:09 -07:00
Fabricio Voznika b30130567d Enable SubprocessExited and SubprocessZombie for gVisor
Updates #164

PiperOrigin-RevId: 305544029
2020-04-08 13:34:44 -07:00
Bin Lu a86ffefd3f Enable exec_binary syscall test on Arm64
Signed-off-by: Bin Lu <bin.lu@arm.com>
2020-04-08 04:23:11 -04:00
Andrei Vagin c7d841ac6e tests: Specify NoRandomSave for PortReuse tests
SO_REUSEPORT is not properly restored:
https://github.com/google/gvisor/issues/873

PiperOrigin-RevId: 305422775
2020-04-08 00:26:28 -07:00
Ting-Yu Wang 71770e5662 mkdir test: Address TODOs and re-enable a test.
PiperOrigin-RevId: 305328184
2020-04-07 13:28:33 -07:00
Fabricio Voznika 94319a8241 Make gofer.dentry.destroyLocked idempotent
gofer operations accumulate dentries touched in a slice to call
checkCachingLocked on them when the operation is over. In case
the same dentry is touched multiple times during the operation,
checkCachingLocked, and consequently destroyLocked, may be called
more than once for the same dentry.

Updates #1198

PiperOrigin-RevId: 305276819
2020-04-07 09:41:58 -07:00
Dean Deng 4baa7e7079 Bump up acceptable sample count for flaky itimer test.
Running the test 1000x almost always produces 1+ test failures where
the sample count is slightly more than 60.

PiperOrigin-RevId: 305051754
2020-04-06 09:51:26 -07:00
Adin Scannell a94309628e Ensure EOF is handled propertly during splice.
PiperOrigin-RevId: 304684417
2020-04-03 13:40:51 -07:00
Tamir Duberstein ea98693d91 Add missing newline
PiperOrigin-RevId: 304659346
2020-04-03 11:38:37 -07:00
gVisor bot 1921c246a9 Internal change.
PiperOrigin-RevId: 304641990
2020-04-03 10:20:55 -07:00
Dean Deng 5b2396d244 Fix typo in TODO comments.
PiperOrigin-RevId: 304508083
2020-04-02 17:07:13 -07:00
Bhasker Hariharan c6d5742c21 Fix flaky TCPLinger2TimeoutAfterClose test.
The test is flaky in cooperative S/R mode because TCP timers are not restored
across a S/R. This can cause the TCPLinger2 timer to not fire. This change
disables S/R before setting the TCP_LINGER2 timeout.

PiperOrigin-RevId: 304430536
2020-04-02 10:41:12 -07:00
Dean Deng 639d94f9f7 Add socket filesystem and global disconnected socket mount for VFS2.
A socket mount where anonymous sockets will reside is added to the
VirtualFilesystem. Socketfs is built on top of kernfs.

Updates #1476, #1478, #1484, #1485.

PiperOrigin-RevId: 304095251
2020-03-31 19:17:12 -07:00
Haibo Xu 8ce5b56971 Cleanup for syscall tests on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I8008c0375fc7e23225a21026f359e78e691729e5
2020-03-31 13:39:38 +08:00
gVisor bot f5fbe859ed Merge pull request #2177 from xiaobo55x:sysret_test
PiperOrigin-RevId: 303158421
2020-03-26 11:37:45 -07:00
gVisor bot 3afbe5461a Merge pull request #2151 from xiaobo55x:seccomp_test
PiperOrigin-RevId: 302987344
2020-03-25 15:59:53 -07:00
Fabricio Voznika e541ebec2f Misc fixes to make stat_test pass (almost)
The only test failing now requires socket which is not
available in VFS2 yet.

Updates #1198

PiperOrigin-RevId: 302976572
2020-03-25 14:59:15 -07:00
Andrei Vagin f97858011f Open a temp directory before changing capabilities and user ID-s
In cl/302130790, we started using a temp directory which is provided by bazel.

By default, a test process has enough permissions to open it, but there is not
any guarantee that it still will be able to do this after changing credentials.

PiperOrigin-RevId: 302702337
2020-03-24 10:58:51 -07:00
Ian Lewis a730d74b32 Support basic /proc/net/dev metrics for netstack
Fixes #506

PiperOrigin-RevId: 302540404
2020-03-23 16:12:58 -07:00
Haibo Xu 9c35d7eb1f Enable syscall sysret_test on arm64.
Fixes #2058

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I05750d238a6425d3a47fae15720901f4dd924a32
2020-03-18 09:27:19 +00:00
Ting-Yu Wang 69da42885a Enable ARP resolution in TAP devices.
PiperOrigin-RevId: 301208471
2020-03-16 12:03:27 -07:00
Dean Deng 5e413cad10 Plumb VFS2 imported fds into virtual filesystem.
- When setting up the virtual filesystem, mount a host.filesystem to contain
  all files that need to be imported.
- Make read/preadv syscalls to the host in cases where preadv2 may not be
  supported yet (likewise for writing).
- Make save/restore functions in kernel/kernel.go return early if vfs2 is
  enabled.

PiperOrigin-RevId: 300922353
2020-03-14 07:14:33 -07:00
Haibo Xu 333b74dc28 Enable syscall seccomp test on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Ibc926c917d98b31fc92bbf8d82d6818c39b0f93c
2020-03-13 05:40:13 +00:00
Ting-Yu Wang bbf86003bf Remove flaky network namespace test that uses clone().
PiperOrigin-RevId: 300626011
2020-03-12 14:35:25 -07:00
gVisor bot 2c2622b942 Merge pull request #1975 from nybidari:iptables
PiperOrigin-RevId: 300362789
2020-03-11 11:02:04 -07:00
Ting-Yu Wang b36de6e7be Move /proc/net to /proc/PID/net, and make /proc/net -> /proc/self/net.
Issue #1833

PiperOrigin-RevId: 299998105
2020-03-09 19:59:09 -07:00
Eyal Soha d5dbe366bf shutdown(s, SHUT_WR) in TIME-WAIT returns ENOTCONN
From RFC 793 s3.9 p61 Event Processing:

CLOSE Call during TIME-WAIT: return with "error: connection closing"

Fixes #1603

PiperOrigin-RevId: 299401353
2020-03-06 11:42:34 -08:00
Ian Lewis da48fc6cca Stub oom_score_adj and oom_score.
Adds an oom_score_adj and oom_score proc file stub. oom_score_adj accepts
writes of values -1000 to 1000 and persists the value with the task. New tasks
inherit the parent's oom_score_adj.

oom_score is a read-only stub that always returns the value '0'.

Issue #202

PiperOrigin-RevId: 299245355
2020-03-05 18:23:01 -08:00
gVisor bot b1576e5332 Merge pull request #2036 from xiaobo55x:syscall_test
PiperOrigin-RevId: 299151227
2020-03-05 11:34:09 -08:00
Andrei Vagin 504c9e14d6 test/runner: use proper filters for test cases
The benchmark_filter options accepts regex-s, but
the gtest-filter option accepts shell-like wildcards.

Fixes #2034

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2020-03-04 12:52:13 -08:00
gVisor bot ba8b8154e8 Merge pull request #2008 from lubinszARM:pr_skip_vsyscall
PiperOrigin-RevId: 298683693
2020-03-03 13:48:00 -08:00