Commit Graph

2159 Commits

Author SHA1 Message Date
Jay Zhuang 17867c88f7 Include <netinet/tcp.h> for TCP enums in proc_net tests
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-09 13:37:32 -08:00
Fabricio Voznika 898dcc2f83 Redirect TODOs to gvisor.dev
PiperOrigin-RevId: 284606233
2019-12-09 12:11:28 -08:00
Bhasker Hariharan cb5f9b8f86 Mark test as non flaky.
PiperOrigin-RevId: 284606133
2019-12-09 12:04:51 -08:00
Adin Scannell cf477c86ca Mark runner_test as manual.
Because it is local-only, it should also be marked manual.

PiperOrigin-RevId: 284596186
2019-12-09 11:28:41 -08:00
Michael Pratt 498595d543 Add tests for rseq(2)
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-09 11:22:31 -08:00
Fabricio Voznika 01eadf51ea Bump up Go 1.13 as minimum requirement
PiperOrigin-RevId: 284320186
2019-12-06 23:10:15 -08:00
Fabricio Voznika 3c2e2f7d12 Update Kokoro image to install Golang 1.13
PiperOrigin-RevId: 284308422
2019-12-06 20:13:09 -08:00
gVisor bot e70636d7f1 Merge pull request #1233 from xiaobo55x:compatLog
PiperOrigin-RevId: 284305935
2019-12-06 19:41:39 -08:00
Mithun Iyer b1d44be7ad Add TCP stats for connection close and keep-alive timeouts.
Fix bugs in updates to TCP CurrentEstablished stat.

Fixes #1277

PiperOrigin-RevId: 284292459
2019-12-06 17:17:33 -08:00
Adin Scannell 371e210b83 Add runtime tracing.
This adds meaningful annotations to the trace generated by the runtime/trace
package.

PiperOrigin-RevId: 284290115
2019-12-06 17:00:07 -08:00
Bhasker Hariharan 3e84777d2e Fix flakiness in tcp_test.
This change marks the socket as ESTABLISHED and creates the receiver and sender
the moment we send the final ACK in case of an active TCP handshake or when we
receive the final ACK for a passive TCP handshake. Before this change there was
a short window in which an ACK can be received and processed but the state on
the socket is not yet ESTABLISHED.

This can be seen in TestConnectBindToDevice which is flaky because sometimes
the socket is in SYN-SENT and not ESTABLISHED even though the other side has
already received the final ACK of the handshake.

PiperOrigin-RevId: 284277713
2019-12-06 15:46:26 -08:00
Michael Pratt 7b81633ff8 Build with C++17
This will require a reasonably modern toolchain. I've put minimum compiler
versions in the README based on versions in
https://en.cppreference.com/w/cpp/compiler_support that have mostly complete
language and library support.

The minimum Bazel version bump is unrelated, but 0.28 is definitely not
supported anymore.

Please report issues on gvisor.dev/issue/1349.

Fixes #1349

PiperOrigin-RevId: 284274250
2019-12-06 15:26:47 -08:00
Ghanan Gowripalan ab3f7bc393 Do IPv6 Stateless Address Auto-Configuration (SLAAC)
This change allows the netstack to do SLAAC as outlined by RFC 4862 section 5.5.

Note, this change will not break existing uses of netstack as the default
configuration for the stack options is set in such a way that SLAAC
will not be performed. See `stack.Options` and `stack.NDPConfigurations` for
more details.

This change reuses 1 option and introduces a new one that is required to take
advantage of SLAAC, all available under NDPConfigurations:
- HandleRAs: Whether or not NDP RAs are processes
- AutoGenGlobalAddresses: Whether or not SLAAC is performed.

Also note, this change does not deprecate SLAAC generated addresses after the
preferred lifetime. That will come in a later change (b/143713887). Currently,
only the valid lifetime is honoured.

Tests: Unittest to make sure that SLAAC generates and adds addresses only when
configured to do so. Tests also makes sure that conflicts with static addresses
do not modify the static address.
PiperOrigin-RevId: 284265317
2019-12-06 14:41:30 -08:00
Nicolas Lacasse 663fe840f7 Implement TTY field in control.Processes().
Threadgroups already know their TTY (if they have one), which now contains the
TTY Index, and is returned in the Processes() call.

PiperOrigin-RevId: 284263850
2019-12-06 14:34:13 -08:00
Fabricio Voznika ea7a100202 Make annotations OCI compliant
Changed annotation to follow the standard defined here:
https://github.com/opencontainers/image-spec/blob/master/annotations.md

PiperOrigin-RevId: 284254847
2019-12-06 13:51:38 -08:00
Dean Deng b0066217ec Add hostinet tests for UDP sockets.
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-06 12:14:23 -08:00
gVisor bot 6780740081 Merge pull request #1314 from google:dependabot/npm_and_yarn/benchmarks/workloads/node_template/lodash-4.17.15
PiperOrigin-RevId: 284210333
2019-12-06 10:19:56 -08:00
Michael Pratt f8bb3f7904 Document ELF PT_LOAD difference from Linux
PiperOrigin-RevId: 284191345
2019-12-06 08:37:14 -08:00
Fabricio Voznika 40035d7d9c Fix possible race condition destroying container
When the sandbox is destroyed, making URPC calls to destroy the
container will fail. The code was checking if the sandbox was
running before attempting to make the URPC call, but that is racy.

PiperOrigin-RevId: 284093764
2019-12-05 17:58:36 -08:00
Ian Gudger 13f0f6069a Implement F_GETOWN_EX and F_SETOWN_EX.
Some versions of glibc will convert F_GETOWN fcntl(2) calls into F_GETOWN_EX in
some cases.

PiperOrigin-RevId: 284089373
2019-12-05 17:28:52 -08:00
Bhasker Hariharan f053c52812 Reduce flakiness under gotsan runs.
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-05 13:57:08 -08:00
Zach Koopmans 0a32c02357 Create correct file for /proc/[pid]/task/[tid]/io
PiperOrigin-RevId: 284038840
2019-12-05 13:24:05 -08:00
Jamie Liu 02258607f9 Add vfs.CheckSetStat() and its dependencies.
PiperOrigin-RevId: 284033820
2019-12-05 12:58:07 -08:00
Ghanan Gowripalan 10f7b109ab Add a type to represent the NDP Recursive DNS Server option
This change adds a type to represent the NDP Recursive DNS Server option, as
defined by RFC 8106 section 5.1.

PiperOrigin-RevId: 284005493
2019-12-05 10:41:45 -08:00
gVisor bot 05758f34b2 Explicitly export files needed by other packages
PiperOrigin-RevId: 283955946
2019-12-05 05:45:09 -08:00
Dean Deng 6ae64d7935 Allow syscall tests to run with hostinet.
Fixes #1207

PiperOrigin-RevId: 283914438
2019-12-04 23:45:49 -08:00
Fabricio Voznika 1eda90d084 Remove TODO since we don't plan to support debug registers
PiperOrigin-RevId: 283828423
2019-12-04 13:54:38 -08:00
Bin Lu 70b68bb058 Add a floating test case for Arm64
Signed-off-by: Bin Lu <bin.lu@arm.com>
2019-12-04 16:28:28 +08:00
Dean Deng 80b7ba0c97 Clean up readv_socket test suite.
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-03 19:42:20 -08:00
Fabricio Voznika bb641c5403 Point TODO to gvisor.dev
PiperOrigin-RevId: 283657725
2019-12-03 17:33:50 -08:00
dependabot[bot] 4c1fa402b3
Bump lodash in /benchmarks/workloads/node_template
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-04 01:31:08 +00:00
Andrei Vagin cf7f27c167 net/udp: return a local route address as the bound-to address
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-03 16:32:13 -08:00
Zach Koopmans 0354071539 Fix printing /proc/[pid]/io for /proc/[pid]/task/[tid]/io.
PiperOrigin-RevId: 283630669
2019-12-03 15:07:49 -08:00
Bhasker Hariharan 27e2c4ddca Fix panic due to early transition to Closed.
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-03 14:41:55 -08:00
Andrei Vagin 43643752f0 strace: don't create a slice with a negative value
PiperOrigin-RevId: 283613824
2019-12-03 13:49:38 -08:00
Fabricio Voznika 154dcdec07 Remove watchdog TODO
I have not seen a false positive stuck task yet.
Biggest offender was whitelistfs which is going away.

PiperOrigin-RevId: 283613064
2019-12-03 13:44:06 -08:00
Fabricio Voznika 3e832bec1b Point TODOs to gvisor.dev
PiperOrigin-RevId: 283610781
2019-12-03 13:32:31 -08:00
Michael Pratt d7cc2480cb Add RunfilesPath to test_util
A few tests have their own ad-hoc implementations. Add a single common one.

PiperOrigin-RevId: 283601666
2019-12-03 12:47:03 -08:00
Zach Koopmans 812189664c Remove TODO for obsolete bug.
PiperOrigin-RevId: 283571456
2019-12-03 10:23:19 -08:00
Dean Deng 19b2d997ec Support IP_TOS and IPV6_TCLASS socket options for hostinet sockets.
There are two potential ways of sending a TOS byte with outgoing packets:
including a control message in sendmsg, or setting the IP_TOS/IPV6_TCLASS
socket options (for IPV4 and IPV6 respectively). This change lets hostinet
support the latter.

Fixes #1188

PiperOrigin-RevId: 283550925
2019-12-03 08:33:22 -08:00
Haibo Xu 03760e5623 platform/ptrace: make some operations arch specific
Make the patchSignalInfo/cpuid faulting/initial thread seccomp rules
operations architecture dependent.

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Iaf692dbe3700d2e01168ec2f1b4beeda9136fd62
2019-12-03 07:17:34 +00:00
Zach Koopmans ce32c06843 Import benchmark-tools to main repository.
This has adapted for use with bazel from the original commit
a26e93769ebefd82593a43e22fb13a09717cfa6d.

In particular, the style has been made consistent with internal python style
guidelines, and the packages (including the main entrypoint) have been
refactored in order to allow bazel testing targets.

PiperOrigin-RevId: 283484433
2019-12-02 22:53:26 -08:00
Haibo Xu 61f2274cb6 Enable runsc compatLog support on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I3fd5e552f5f03b5144ed52647f75af3b8253b1d6
2019-12-03 03:25:54 +00:00
Ian Lewis 7ac46c5048 Allow non-unique UIDs in bazel docker containers
Allow non-unique UIDs in the bazel docker container in order to avoid failures
using host UIDs that are already present in the image.

Issue #1267

PiperOrigin-RevId: 283456369
2019-12-02 18:00:33 -08:00
Andrei Vagin b41277049c test/syscal: Don't skip ClockGettime.CputimeId
We skipped it due to the issue in the golang scheduler
which has been fixed in go1.13.

PiperOrigin-RevId: 283432226
2019-12-02 15:37:17 -08:00
Dean Deng 9194aab2aa Support sending IP_TOS and IPV6_TCLASS control messages with hostinet sockets.
There are two potential ways of sending a TOS byte with outgoing packets:
including a control message in sendmsg, or setting the IP_TOS/IPV6_TCLASS
socket options (for IPV4 and IPV6 respectively). This change lets hostinet
support the former.

PiperOrigin-RevId: 283346737
2019-12-02 08:40:16 -08:00
Jay Zhuang 1518f7fd38 Fix typo, s/Convertable/Convertible/g
PiperOrigin-RevId: 283345791
2019-12-02 08:33:43 -08:00
Jay Zhuang aa70523da2 Port tests in udp_socket.cc to Fuchsia
Separate out a test in udp_socket.cc that depends on <linux/errqueue.h> so the
rest of the tests can run on Fuchsia.

PiperOrigin-RevId: 283322633
2019-12-02 05:38:30 -08:00
Ghanan Gowripalan 10bbcf97d2 Test handling segments on completed but not yet accepted TCP connections
This change does not introduce any new features, or modify existing ones.

This change tests handling TCP segments right away for connections that were
completed from a listening endpoint.

PiperOrigin-RevId: 282986457
2019-11-28 17:15:07 -08:00
Dean Deng 684f757a22 Add support for receiving TOS and TCLASS control messages in hostinet.
This involves allowing getsockopt/setsockopt for the corresponding socket
options, as well as allowing hostinet to process control messages received from
the actual recvmsg syscall.

PiperOrigin-RevId: 282851425
2019-11-27 16:21:05 -08:00