Commit Graph

3667 Commits

Author SHA1 Message Date
Fabricio Voznika 1bfb556ccd Prepare boot.Loader to support multi-container TTY
- Combine process creation code that is shared between
  root and subcontainer processes
- Move root container information into a struct for
  clarity

Updates #2714

PiperOrigin-RevId: 321204798
2020-07-14 12:02:03 -07:00
Jay Zhuang 822fc99ecd Add support for UDP IPv6
Also ironed out all the bugs found on the IPv6 code path that affects socket
bind, send and receive.

PiperOrigin-RevId: 321202653
2020-07-14 11:49:51 -07:00
Ting-Yu Wang 87c33be9af Enable experimental features in docker.
PiperOrigin-RevId: 321062975
2020-07-13 17:02:32 -07:00
gVisor bot c5d827d110 Merge pull request #3200 from lubinszARM:pr_kvm_ut_1
PiperOrigin-RevId: 321060717
2020-07-13 16:49:20 -07:00
gVisor bot c81ac8ec3b Merge pull request #2672 from amscanne:shim-integrated
PiperOrigin-RevId: 321053634
2020-07-13 16:10:58 -07:00
Fabricio Voznika 59a5479409 Disable debug time adjustment logging
When --debug is enabled, the following log messages are
printed every second filling up the log:

D0430 18:04:42.823775  129561 parameters.go:238] Clock(Monotonic): error: 46 ns, adjusted frequency from 3591713733 Hz to 3591714196 Hz
D0430 18:04:42.823870  129561 parameters.go:238] Clock(Realtime): error: 36 ns, adjusted frequency from 3591714003 Hz to 3591714169 Hz
D0430 18:04:42.823892  129561 timekeeper.go:209] Updating VDSO parameters: {monotonicReady:1 monotonicBaseCycles:15758797714254696 monotonicBaseRef:29000233837 monotonicFrequency:3591714196 realtimeReady:1 realtimeBaseCycles:15758797714610880 realtimeBaseRef:1588269882823867374 realtimeFrequency:3591714169}

Info and warning messages for larger changes are kept the same.

PiperOrigin-RevId: 321048523
2020-07-13 15:42:53 -07:00
Ian Lewis 74df310ac0 Don't run issue reviver on forks.
Add a conditional to avoid running the issue reviver on forks. It will
always cause errors since bug references in the source code don't match
issue IDs in forked repos.

PiperOrigin-RevId: 321042060
2020-07-13 15:07:00 -07:00
Ting-Yu Wang a287309d9f Fix recvMMsgDispatcher not slicing link header correctly.
PiperOrigin-RevId: 321035635
2020-07-13 14:36:38 -07:00
Ayush Ranjan 28c635e5d4 Fix runtime test target
PiperOrigin-RevId: 321029113
2020-07-13 14:07:41 -07:00
Dean Deng cf0826653c Clean up inotify comments.
PiperOrigin-RevId: 321028238
2020-07-13 14:02:07 -07:00
Kevin Krakauer 3fe9be138c iptables: remove useless ip6tables VM rules
This rule isn't restored when the Kokoro VM is restarted, so it's not doing
anything. And the problem it was meant to solved is instead addressed by
https://github.com/google/gvisor/pull/3207.

PiperOrigin-RevId: 321026846
2020-07-13 13:54:54 -07:00
Ayush Ranjan 6994f4d591 [vfs2] Make gofer metadata atomics consistent
For accessing metadata fields:
- If metadataMu is locked, we can access without atomics
- If metadataMu is unlocked, we should use atomics

For mutating metadata fields:
- Always lock metadataMu and use atomics.

There were some instances of inconsistencies which have been fixed.

PiperOrigin-RevId: 321022895
2020-07-13 13:35:32 -07:00
Zach Koopmans b8d3d09bd1 Initial golang Benchmarks
PiperOrigin-RevId: 321021071
2020-07-13 13:29:30 -07:00
gVisor bot 505b4f5e5f Merge pull request #3136 from lubinszARM:pr_sys64_1
PiperOrigin-RevId: 321020733
2020-07-13 13:24:01 -07:00
Fabricio Voznika b7e8ce93de Add ReadAllFd to test util
PiperOrigin-RevId: 321008185
2020-07-13 12:23:18 -07:00
Kevin Krakauer 43c209f48e garbage collect connections
As in Linux, we must periodically clean up unused connections.

PiperOrigin-RevId: 321003353
2020-07-13 12:00:46 -07:00
Jay Zhuang 76b392bc26 Create packetimpact test for UDP broadcast
PiperOrigin-RevId: 321000340
2020-07-13 11:49:06 -07:00
Adin Scannell 60dc5a4479 Automated rollback of changelist 320972241
PiperOrigin-RevId: 320999851
2020-07-13 11:43:28 -07:00
Jay Zhuang bafef1cf3a Print testbench log on packetimpact failures
These logs include flags passed to packetimpact tests (the Go tests), and test
failure messages.

PiperOrigin-RevId: 320989521
2020-07-13 10:58:21 -07:00
Adin Scannell 7ff4649b3c Use host networking for build container.
This will allow the use of default credentials.

PiperOrigin-RevId: 320972241
2020-07-13 09:39:06 -07:00
Ghanan Gowripalan 9c32fd3f4d Do not copy sleep.Waker
sleep.Waker's fields are modified as values.

PiperOrigin-RevId: 320873451
2020-07-12 17:22:08 -07:00
Ayush Ranjan 69f2059e5d Runtime test batch executor
Earlier we were docker exec-ing each test at a time. However invoking the test
framework has a fixed overhead which made it infeasible to make the runtime
tests run as presubmits. This change now executes tests in batches of 50 (can
be altered). This really speeds up testing process.

With this change, the following tests can be run in reasonable times:
- Go
- Nodejs
- Php
- Python

PiperOrigin-RevId: 320763916
2020-07-11 08:18:35 -07:00
Bhasker Hariharan 216dcebc06 Stub out SO_DETACH_FILTER.
Updates #2746

PiperOrigin-RevId: 320757963
2020-07-11 06:22:47 -07:00
Bin Lu feb867bb83 Split the kvm ut test cases to correspond to different platforms
Split the kvm ut test cases to pass unit-tests on Arm64.
    I will add the tls and full-context test cases for Arm64 later.

Signed-off-by: Bin Lu <bin.lu@arm.com>
2020-07-10 03:13:13 -04:00
gVisor bot 5df3a8fede Discard multicast UDP source address.
RFC-1122 (and others) specify that UDP should not receive
datagrams that have a source address that is a multicast address.
Packets should never be received FROM a multicast address.
See also, RFC 768:  'User Datagram Protocol'
J. Postel, ISI, 28 August 1980
  A UDP datagram received with an invalid IP source address
    (e.g., a broadcast or multicast address) must be discarded
    by UDP or by the IP layer (see rfc 1122 Section 3.2.1.3).
This CL does not address TCP or broadcast which is more complicated.

Also adds a test for both ipv6 and ipv4 UDP.

Fixes #3154

PiperOrigin-RevId: 320547674
2020-07-09 22:35:42 -07:00
Adin Scannell 2afff44403 Update shim to build using bazel.
The go.mod dependency tree for the shim was somehow contradictory. After
resolving these issues (e.g. explicitly imported k8s 1.14, pulling a
specific dbus version), and adding all dependencies, the shim can now be
build as part of the regular bazel tree.

As part of this process, minor cleanup was done in all the source files:
headers were standardized (and include "The gVisor Authors" in addition
to the "The containerd Authors" if originally derived from containerd
sources), and comments were cleaned up to meet coding standards.

This change makes the containerd installation dynamic, so that multiple
versions can be tested, and drops the static installer for the VM image
itself.

This change also updates test/root/crictl_test.go and related utilities,
so that the containerd tests can be run on any version (and in cases
where it applies, they can be run on both v1 and v2 as parameterized
tests).
2020-07-09 17:39:47 -07:00
Adin Scannell 2f24ab3397 Allow arbitrary Go commands for go_mod.sh. 2020-07-09 16:59:43 -07:00
Adin Scannell 60e19587ce Update canonical paths. 2020-07-09 16:59:42 -07:00
Adin Scannell 5471dbe2f3 Merge gvisor-containerd-shim 2020-07-09 16:59:42 -07:00
Bhasker Hariharan 5946f11182 Add support for IP_HDRINCL IP option for raw sockets.
Updates #2746
Fixes #3158

PiperOrigin-RevId: 320497190
2020-07-09 16:25:57 -07:00
Ian Lewis e506fcd931 Add args and netns flag to runsc spec
Adds a netns flag to runsc spec that allows users to specify a network
namespace path when creating a sample config.json file. Also, adds the ability
to specify the command arguments used when running the container.

This will make it easier for new users to create sample OCI bundles without
having to edit the config.json by hand.

PiperOrigin-RevId: 320486267
2020-07-09 15:26:52 -07:00
Michael Pratt 8d2910a04d Explain how to bypass the Docker proxy
Neither myself nor bhaskerh@ can consistently remember how to do this.

PiperOrigin-RevId: 320407005
2020-07-09 09:04:47 -07:00
Fabricio Voznika c4815af947 Add shared mount hints to VFS2
Container restart test is disabled for VFS2 for now.

Updates #1487

PiperOrigin-RevId: 320296401
2020-07-08 17:12:29 -07:00
gVisor bot 4f7af437e2 Merge pull request #3171 from kevinGC:ipv6-kokoro
PiperOrigin-RevId: 320290162
2020-07-08 16:36:33 -07:00
Michael Pratt a75d9f7bee Drop empty line
PiperOrigin-RevId: 320281516
2020-07-08 15:48:01 -07:00
Kevin Krakauer 14ff2ea9bf ip6tables: handle both IPv4 and v6 addresses
Enabling IPv6 in Docker caused IPv4 tests to fail because localAddrs
didn't distinguish between address types. Example failure:
https://source.cloud.google.com/results/invocations/203b2401-3333-4bec-9a56-72cc53d68ddd/log
2020-07-08 15:14:29 -07:00
Zach Koopmans f3fa43cf23 Move all tests to new docker API.
Moves following to new dockerutil API:
- //test/e2e:integration_test
- //test/image:image_test
- //test/iptables:iptables_test
- //test/root:root_test
- //test/packetimpact:packetimpact_test

PiperOrigin-RevId: 320253118
2020-07-08 13:26:23 -07:00
Tamir Duberstein e1f11dea28 Avoid accidental zero-checksum
PiperOrigin-RevId: 320250773
2020-07-08 13:13:44 -07:00
Ayush Ranjan e3db9bda60 Enable shards in runtime test runner.
Fixed an issue with the runtime test runner which enables us to run tests in
shards. We had to touch the status file as indicated by an env var.

PiperOrigin-RevId: 320236205
2020-07-08 12:05:04 -07:00
Ayush Ranjan efa2615eb0 [vfs2] Remove VFS1 usage in VDSO.
Removed VDSO dependency on VFS1.

Resolves #2921

PiperOrigin-RevId: 320122176
2020-07-07 21:37:08 -07:00
Jamie Liu 5e05950c1c Deflake exec test.
- Only use MAXSYMLINKS/2+1 symlinks for each of the interpreter and script
  paths in SymlinkLimitRefreshedForInterpreter to tolerate cases where the
  original paths (/tmp, /bin, or /bin/echo) themselves contain symlinks.

- Ensure that UnshareFiles performs execve immediately after clone(CLONE_VFORK)
  (no heap allocation for ExecveArray/RunfilesPath).

- Use lstat() rather than stat() for the existence check in fs_util's Exists;
  the latter will fail if the symlink target does not exist, even if the
  symlink does.

PiperOrigin-RevId: 320110156
2020-07-07 19:45:16 -07:00
Tony Gong 76c7bc51b7 Set IPv4 ID on all non-atomic datagrams
RFC 6864 imposes various restrictions on the uniqueness of the IPv4
Identification field for non-atomic datagrams, defined as an IP datagram that
either can be fragmented (DF=0) or is already a fragment (MF=1 or positive
fragment offset). In order to be compliant, the ID field is assigned for all
non-atomic datagrams.

Add a TCP unit test that induces retransmissions and checks that the IPv4
ID field is unique every time. Add basic handling of the IP_MTU_DISCOVER
socket option so that the option can be used to disable PMTU discovery,
effectively setting DF=0. Attempting to set the sockopt to anything other
than disabled will fail because PMTU discovery is currently not implemented,
and the default behavior matches that of disabled.

PiperOrigin-RevId: 320081842
2020-07-07 16:14:49 -07:00
Ting-Yu Wang 7e4d2d63ee icmp: When setting TransportHeader, remove from the Data portion.
The current convention is when a header is set to pkt.XxxHeader field, it
gets removed from pkt.Data. ICMP does not currently follow this convention.

PiperOrigin-RevId: 320078606
2020-07-07 15:56:46 -07:00
Ayush Ranjan 10930189c3 Fix mknod and inotify syscall test
This change fixes a few things:
- creating sockets using mknod(2) is supported via vfs2
- fsgofer can create regular files via mknod(2)
- mode = 0 for mknod(2) will be interpreted as regular file in vfs2 as well

Updates #2923

PiperOrigin-RevId: 320074267
2020-07-07 15:35:01 -07:00
gVisor bot c8aab5cbee Merge pull request #3149 from wietsevenema:patch-1
PiperOrigin-RevId: 320062822
2020-07-07 14:36:43 -07:00
Wietse Venema c0ea7d9e9e
README.md: Commpatibility > Compatibility 2020-07-07 16:32:15 +02:00
Jamie Liu e227450dc1 Call fdnotifier.UpdateFD() from fsimpl/gofer.specialFileFD.
The fdnotifier package provides an API to a thread that continually epolls
arbitrary host FDs. The set of events polled for each host FD is (intended to
be) all events for which a waiter.Entry has expressed interest, as returned by
waiter.Queue.Events() for the waiter.Queue registered to the given host FD.
When the set of events changes (due to a change in the set of registered
waiter.Entries), the mutator must call fdnotifier.UpdateFD() to recalculate the
new event set and propagate it to the epoll FD.

PiperOrigin-RevId: 319924719
2020-07-06 22:55:48 -07:00
Fabricio Voznika 937912a484 Ensure sync is called for readonly file
Calling sync on a readonly file flushes metadata that
may have been modified, like last access time.

Updates #1198

PiperOrigin-RevId: 319888290
2020-07-06 17:29:01 -07:00
Bhasker Hariharan b0f656184e Add support for SO_RCVBUF/SO_SNDBUF for AF_PACKET sockets.
Updates #2746

PiperOrigin-RevId: 319887810
2020-07-06 17:22:54 -07:00
Ting-Yu Wang 15c56d92d8 Fix NonBlockingWrite3 not writing b3 if b2 is zero-length.
PiperOrigin-RevId: 319882171
2020-07-06 16:47:37 -07:00