Commit Graph

7833 Commits

Author SHA1 Message Date
gVisor bot 06bcbc23fd Merge release-20210112.0-37-g12d979083 (automated) 2021-01-16 00:07:58 +00:00
Tamir Duberstein 12d9790833 Remove count argument from tcpip.Endpoint.Read
The same intent can be specified via the io.Writer.

PiperOrigin-RevId: 352098747
2021-01-15 15:49:15 -08:00
gVisor bot 0b4604d503 Merge release-20210112.0-36-gf37ace666 (automated) 2021-01-15 23:35:16 +00:00
gVisor bot 05c0716480 Merge release-20210112.0-35-gec9e263f2 (automated) 2021-01-15 23:25:52 +00:00
gVisor bot 7fabef0a1c Merge release-20210112.0-34-g55c7fe48d (automated) 2021-01-15 23:20:59 +00:00
Ayush Ranjan f37ace6661 [rack] Retransmit the probe segment after the probe timer expires.
This change implements TLP details enumerated in
https://tools.ietf.org/html/draft-ietf-tcpm-rack-08#section-7.5.2.

Fixes #5084

PiperOrigin-RevId: 352093473
2021-01-15 15:19:45 -08:00
Ting-Yu Wang ec9e263f21 Correctly return EMSGSIZE when packet is too big in raw socket.
IPv4 previously accepts the packet, while IPv6 panics. Neither is the behavior
in Linux.

splice() in Linux has different behavior than in gVisor. This change documents
it in the SpliceTooLong test.

Reported-by: syzbot+b550e78e5c24d1d521f2@syzkaller.appspotmail.com
PiperOrigin-RevId: 352091286
2021-01-15 15:10:27 -08:00
gVisor bot 8103a494e6 Merge release-20210112.0-33-gc7fc4a5d6 (automated) 2021-01-15 23:08:00 +00:00
Ghanan Gowripalan 55c7fe48d2 Populate EgressRoute, GSO, Netproto for batch writes
We loop over the list of packets anyways so setting these aren't
expensive.

Now that they are populated only by the link endpoint that uses them,
TCP does not need to.

PiperOrigin-RevId: 352090853
2021-01-15 15:03:47 -08:00
gVisor bot b71d19fd29 Merge release-20210112.0-32-g9db126eb6 (automated) 2021-01-15 22:57:44 +00:00
Fabricio Voznika c7fc4a5d66 Add fsstress tests
Updates #5273

PiperOrigin-RevId: 352088736
2021-01-15 14:51:51 -08:00
Dean Deng 9db126eb65 Combine reference count logs into one message.
Otherwise, races can occur between concurrent logs.

PiperOrigin-RevId: 352086914
2021-01-15 14:40:26 -08:00
gVisor bot eebe9d4f8c Merge release-20210112.0-31-gf03144d88 (automated) 2021-01-15 21:17:18 +00:00
gVisor bot 85b1c8c285 Merge release-20210112.0-30-gf1420cf48 (automated) 2021-01-15 21:07:37 +00:00
Fabricio Voznika f03144d886 Support TEST_PREMATURE_EXIT_FILE in syscall tests
PiperOrigin-RevId: 352068182
2021-01-15 13:03:58 -08:00
Ting-Yu Wang f1420cf484 Add sanity check on return values from Write
io.Writer.Write requires err to be non-nil if n < len(v).

We could allow this but it will be irreversible if users depend on this
behavior.

Ported the test that discovered this.

PiperOrigin-RevId: 352065946
2021-01-15 12:51:08 -08:00
gVisor bot ce5dadac7f Merge release-20210112.0-29-gf7f66c8c6 (automated) 2021-01-15 20:20:06 +00:00
Mithun Iyer f7f66c8c6c Add tests for cases of ARP failures on TCP connect
Also fix test expectation for UDP sendto() case in tuntap syscall test.

Fixes #5155

PiperOrigin-RevId: 352056612
2021-01-15 12:03:52 -08:00
gVisor bot da22dc1148 Merge release-20210112.0-28-g714a020ab (automated) 2021-01-15 18:25:40 +00:00
gVisor bot 714a020ab5 Merge pull request #5237 from travigd:add-containerd-pause
PiperOrigin-RevId: 352032380
2021-01-15 10:09:43 -08:00
gVisor bot 578c5460b6 Merge release-20210112.0-25-ge57ebcd37 (automated) 2021-01-15 15:47:01 +00:00
Jamie Liu e57ebcd37a Simplify the pipe implementation.
- Remove the pipe package's dependence on the buffer package, which becomes
  unused as a result. The buffer package is currently intended to serve two use
  cases, pipes and temporary buffers, and does neither optimally as a result;
  this change facilitates retooling the buffer package to better serve the
  latter.

- Pass callbacks taking safemem.BlockSeq to the internal pipe I/O methods,
  which makes most callbacks trivial.

- Fix VFS1's splice() and tee() to immediately return if a pipe returns a
  partial write.

PiperOrigin-RevId: 351911375
2021-01-14 17:35:07 -08:00
Zach Koopmans 95371cff35 Don't run profiles on runc.
PiperOrigin-RevId: 351906812
2021-01-14 17:04:13 -08:00
Arthur Sfez 833516c139 Add stats for ARP
Fixes #4963

Startblock:
  has LGTM from sbalana
  and then
  add reviewer ghanan
PiperOrigin-RevId: 351886320
2021-01-14 15:16:24 -08:00
Fabricio Voznika dbe4176565 Check for existence before permissions
Return EEXIST when overwritting a file as long as the caller has exec
permission on the parent directory, even if the caller doesn't have
write permission.

Also reordered the mount write check, which happens before permission
is checked.

Closes #5164

PiperOrigin-RevId: 351868123
2021-01-14 13:43:10 -08:00
Tamir Duberstein f1ce97294b Remove impossible errors
Commit 25b5ec7 moved link address resolution out of the transport layer;
special handling of link address resolution is no longer necessary in tcp.

PiperOrigin-RevId: 351839254
2021-01-14 11:25:03 -08:00
gVisor bot 6cc587a931 Merge release-20201216.0-106-gc49ce8ca8 (automated) 2021-01-14 01:30:11 +00:00
Ghanan Gowripalan c49ce8ca8a Clear neighbor table on NIC down
Note, this includes static entries to match linux's behaviour.

```
  $ ip neigh show dev eth0
  192.168.42.1 lladdr fc:ec:da:70:6e:f9 STALE
  $ sudo ip neigh add 192.168.42.172 lladdr 22:33:44:55:66:77 dev eth0
  $ ip neigh show dev eth0
  192.168.42.1 lladdr fc:ec:da:70:6e:f9 STALE
  192.168.42.172 lladdr 22:33:44:55:66:77 PERMANENT
  $ sudo ifconfig eth0 down
  $ ip neigh show dev eth0
  $ sudo ifconfig eth0 up
  $ ip neigh show dev eth0
```

Test: stack_test.TestClearNeighborCacheOnNICDisable
PiperOrigin-RevId: 351696306
2021-01-13 17:12:29 -08:00
gVisor bot fc9aec0925 Merge release-20201216.0-105-g25b5ec713 (automated) 2021-01-14 00:18:26 +00:00
Ghanan Gowripalan 25b5ec7135 Do not resolve remote link address at transport layer
Link address resolution is performed at the link layer (if required) so
we can defer it from the transport layer. When link resolution is
required, packets will be queued and sent once link resolution
completes. If link resolution fails, the transport layer will receive a
control message indicating that the stack failed to route the packet.

tcpip.Endpoint.Write no longer returns a channel now that writes do not
wait for link resolution at the transport layer.

tcpip.ErrNoLinkAddress is no longer used so it is removed.

Removed calls to stack.Route.ResolveWith from the transport layer so
that link resolution is performed when a route is created in response
to an incoming packet (e.g. to complete TCP handshakes or send a RST).

Tests:
- integration_test.TestForwarding
- integration_test.TestTCPLinkResolutionFailure

Fixes #4458

RELNOTES: n/a
PiperOrigin-RevId: 351684158
2021-01-13 16:04:33 -08:00
gVisor bot cfa5eea33e Merge release-20201216.0-104-g1efe0ebc5 (automated) 2021-01-13 23:29:05 +00:00
gVisor bot 3a5e85451f Merge release-20201216.0-103-gf34aaf7ef (automated) 2021-01-13 23:26:11 +00:00
Dean Deng 1efe0ebc59 Switch uses of os.Getenv that check for empty string to os.LookupEnv.
Whether the variable was found is already returned by syscall.Getenv.
os.Getenv drops this value while os.Lookupenv passes it along.

PiperOrigin-RevId: 351674032
2021-01-13 15:15:20 -08:00
Etienne Perot f34aaf7ef1 testutil: Create a `multiLogger` that logs to multiple `Loggers`.
This is useful when using the shell library in order to log to both the test
log and the standard logs.

PiperOrigin-RevId: 351673465
2021-01-13 15:09:50 -08:00
Travis DePrato a88d6caf53
Fix code review issues 2021-01-13 13:06:15 -08:00
Travis DePrato 37855aff12
Add support for pause/restore in containerd shim 2021-01-13 13:06:15 -08:00
gVisor bot 8f8b2818af Merge release-20201216.0-102-g64bff178b (automated) 2021-01-13 20:26:14 +00:00
gVisor bot 64bff178b8 Merge pull request #4792 from lubinszARM:pr_kvm_test
PiperOrigin-RevId: 351638451
2021-01-13 12:12:26 -08:00
gVisor bot ebc7c2f25e Merge release-20201216.0-100-ga684bfb6c (automated) 2021-01-13 20:04:39 +00:00
Adin Scannell a684bfb6c0 Split container tests from unit tests.
PiperOrigin-RevId: 351632484
2021-01-13 11:48:50 -08:00
gVisor bot 9e5435c63c Merge release-20201216.0-99-g0f25aa24f (automated) 2021-01-13 18:37:26 +00:00
Arthur Sfez 0f25aa24f9 Clean up the dummy network interface used by UDP tests
It is now composed by a NetworkInterface interface which lets us delete
the methods we don't need.

PiperOrigin-RevId: 351613267
2021-01-13 10:21:53 -08:00
gVisor bot 66f7edeb6e Merge release-20201216.0-98-gaab7d75bd (automated) 2021-01-13 18:04:36 +00:00
Michael Pratt aab7d75bd8 Fix minor typos
PiperOrigin-RevId: 351606635
2021-01-13 09:51:38 -08:00
gVisor bot 4190065e59 Merge release-20201216.0-97-ge4d8f55ce (automated) 2021-01-13 16:33:47 +00:00
Michael Pratt e4d8f55cef Human-readable metric emit logs
Rather than dumping metrics on a single line, nearly unrelated textproto, print
them in alphabetical order, each on their own line.

e.g.,

D0108 17:42:42.198216  3382465 metric.go:253] Emitting metrics:
D0108 17:42:42.198240  3382465 metric.go:255] /fs/opens: &{Uint64Value:22}
D0108 17:42:42.198271  3382465 metric.go:255] /fs/read_wait: &{Uint64Value:0}
D0108 17:42:42.198294  3382465 metric.go:255] /fs/reads: &{Uint64Value:26}
D0108 17:42:42.198319  3382465 metric.go:255] /gofer/opened_write_execute_file: &{Uint64Value:0}
D0108 17:42:42.198327  3382465 metric.go:255] /gofer/opens_9p: &{Uint64Value:0}
D0108 17:42:42.198340  3382465 metric.go:255] /gofer/opens_host: &{Uint64Value:20}
...

PiperOrigin-RevId: 351590340
2021-01-13 08:20:00 -08:00
gVisor bot ac62523cae Merge release-20201216.0-96-g19ab0f15f (automated) 2021-01-13 12:40:07 +00:00
Ayush Ranjan 19ab0f15f3 [rack] TLP: Recovery detection.
This change implements TLP details enumerated in
https://tools.ietf.org/html/draft-ietf-tcpm-rack-08#section-7.6

Fixes #5131

PiperOrigin-RevId: 351558449
2021-01-13 04:25:29 -08:00
gVisor bot 74ddc3735b Merge release-20201216.0-95-gfb95e13df (automated) 2021-01-13 06:40:11 +00:00
Adin Scannell fb95e13df5 Don't remove release directory.
If the release directory is a parent directory (for reasons), then this causes
a few problems (to say the least).

PiperOrigin-RevId: 351515882
2021-01-12 22:25:46 -08:00