Commit Graph

2379 Commits

Author SHA1 Message Date
gVisor bot 57af32e218 Merge release-20190806.1-379-g0c424ea (automated) 2019-11-07 03:45:25 +00:00
Ghanan Gowripalan 0c424ea731 Rename nicid to nicID to follow go-readability initialisms
https://github.com/golang/go/wiki/CodeReviewComments#initialisms

This change does not introduce any new functionality. It just renames variables
from `nicid` to `nicID`.

PiperOrigin-RevId: 278992966
2019-11-06 19:41:25 -08:00
gVisor bot 240b9f2db7 Merge release-20190806.1-378-gadb10f4 (automated) 2019-11-07 01:58:59 +00:00
gVisor bot adb10f4d53 Internal change.
PiperOrigin-RevId: 278979065
2019-11-06 17:56:25 -08:00
gVisor bot 2d83627b99 Merge release-20190806.1-377-gf8ffadd (automated) 2019-11-07 01:15:55 +00:00
Jamie Liu f8ffadddb3 Add p9.OpenTruncate.
This is required to implement O_TRUNC correctly on filesystems backed by
gofers.

9P2000.L: "lopen prepares fid for file I/O. flags contains Linux open(2) flags
bits, e.g. O_RDONLY, O_RDWR, O_WRONLY."

open(2): "The argument flags must include one of the following access modes:
O_RDONLY, O_WRONLY, or O_RDWR. ... In addition, zero or more file creation
flags and file status flags can be bitwise-or'd in flags."

The reference 9P2000.L implementation also appears to expect arbitrary flags,
not just access modes, in Tlopen.flags:
https://github.com/chaos/diod/blob/master/diod/ops.c#L703

PiperOrigin-RevId: 278972683
2019-11-06 17:11:58 -08:00
gVisor bot eeb3249ffe Merge release-20190806.1-376-ge63db5e (automated) 2019-11-07 00:32:32 +00:00
Ghanan Gowripalan e63db5e7bb Discover default routers from Router Advertisements
This change allows the netstack to do NDP's Router Discovery as outlined by
RFC 4861 section 6.3.4.

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 Router Discovery
will not be performed. See `stack.Options` and `stack.NDPConfigurations` for
more details.

This change introduces 2 options required to take advantage of Router Discovery,
all available under NDPConfigurations:
- HandleRAs: Whether or not NDP RAs are processes
- DiscoverDefaultRouters: Whether or not Router Discovery is performed

Another note: for a NIC to process Router Advertisements, it must not be a
router itself. Currently the netstack does not have per-interface routing
configuration; the routing/forwarding configuration is controlled stack-wide.
Therefore, if the stack is configured to enable forwarding/routing, no Router
Advertisements will be processed.

Tests: Unittest to make sure that Router Discovery and updates to the routing
table only occur if explicitly configured to do so. Unittest to make sure at
max stack.MaxDiscoveredDefaultRouters discovered default routers are remembered.
PiperOrigin-RevId: 278965143
2019-11-06 16:29:58 -08:00
gVisor bot 54b6fd090a Merge release-20190806.1-375-ge1b21f3 (automated) 2019-11-06 22:28:41 +00:00
Kevin Krakauer e1b21f3c8c Use PacketBuffers, rather than VectorisedViews, in netstack.
PacketBuffers are analogous to Linux's sk_buff. They hold all information about
a packet, headers, and payload. This is important for:

* iptables to access various headers of packets
* Preventing the clutter of passing different net and link headers along with
  VectorisedViews to packet handling functions.

This change only affects the incoming packet path, and a future change will
change the outgoing path.

Benchmark               Regular         PacketBufferPtr  PacketBufferConcrete
--------------------------------------------------------------------------------
BM_Recvmsg             400.715MB/s      373.676MB/s      396.276MB/s
BM_Sendmsg             361.832MB/s      333.003MB/s      335.571MB/s
BM_Recvfrom            453.336MB/s      393.321MB/s      381.650MB/s
BM_Sendto              378.052MB/s      372.134MB/s      341.342MB/s
BM_SendmsgTCP/0/1k     353.711MB/s      316.216MB/s      322.747MB/s
BM_SendmsgTCP/0/2k     600.681MB/s      588.776MB/s      565.050MB/s
BM_SendmsgTCP/0/4k     995.301MB/s      888.808MB/s      941.888MB/s
BM_SendmsgTCP/0/8k     1.517GB/s        1.274GB/s        1.345GB/s
BM_SendmsgTCP/0/16k    1.872GB/s        1.586GB/s        1.698GB/s
BM_SendmsgTCP/0/32k    1.017GB/s        1.020GB/s        1.133GB/s
BM_SendmsgTCP/0/64k    475.626MB/s      584.587MB/s      627.027MB/s
BM_SendmsgTCP/0/128k   416.371MB/s      503.434MB/s      409.850MB/s
BM_SendmsgTCP/0/256k   323.449MB/s      449.599MB/s      388.852MB/s
BM_SendmsgTCP/0/512k   243.992MB/s      267.676MB/s      314.474MB/s
BM_SendmsgTCP/0/1M     95.138MB/s       95.874MB/s       95.417MB/s
BM_SendmsgTCP/0/2M     96.261MB/s       94.977MB/s       96.005MB/s
BM_SendmsgTCP/0/4M     96.512MB/s       95.978MB/s       95.370MB/s
BM_SendmsgTCP/0/8M     95.603MB/s       95.541MB/s       94.935MB/s
BM_SendmsgTCP/0/16M    94.598MB/s       94.696MB/s       94.521MB/s
BM_SendmsgTCP/0/32M    94.006MB/s       94.671MB/s       94.768MB/s
BM_SendmsgTCP/0/64M    94.133MB/s       94.333MB/s       94.746MB/s
BM_SendmsgTCP/0/128M   93.615MB/s       93.497MB/s       93.573MB/s
BM_SendmsgTCP/0/256M   93.241MB/s       95.100MB/s       93.272MB/s
BM_SendmsgTCP/1/1k     303.644MB/s      316.074MB/s      308.430MB/s
BM_SendmsgTCP/1/2k     537.093MB/s      584.962MB/s      529.020MB/s
BM_SendmsgTCP/1/4k     882.362MB/s      939.087MB/s      892.285MB/s
BM_SendmsgTCP/1/8k     1.272GB/s        1.394GB/s        1.296GB/s
BM_SendmsgTCP/1/16k    1.802GB/s        2.019GB/s        1.830GB/s
BM_SendmsgTCP/1/32k    2.084GB/s        2.173GB/s        2.156GB/s
BM_SendmsgTCP/1/64k    2.515GB/s        2.463GB/s        2.473GB/s
BM_SendmsgTCP/1/128k   2.811GB/s        3.004GB/s        2.946GB/s
BM_SendmsgTCP/1/256k   3.008GB/s        3.159GB/s        3.171GB/s
BM_SendmsgTCP/1/512k   2.980GB/s        3.150GB/s        3.126GB/s
BM_SendmsgTCP/1/1M     2.165GB/s        2.233GB/s        2.163GB/s
BM_SendmsgTCP/1/2M     2.370GB/s        2.219GB/s        2.453GB/s
BM_SendmsgTCP/1/4M     2.005GB/s        2.091GB/s        2.214GB/s
BM_SendmsgTCP/1/8M     2.111GB/s        2.013GB/s        2.109GB/s
BM_SendmsgTCP/1/16M    1.902GB/s        1.868GB/s        1.897GB/s
BM_SendmsgTCP/1/32M    1.655GB/s        1.665GB/s        1.635GB/s
BM_SendmsgTCP/1/64M    1.575GB/s        1.547GB/s        1.575GB/s
BM_SendmsgTCP/1/128M   1.524GB/s        1.584GB/s        1.580GB/s
BM_SendmsgTCP/1/256M   1.579GB/s        1.607GB/s        1.593GB/s

PiperOrigin-RevId: 278940079
2019-11-06 14:25:59 -08:00
gVisor bot 4ec194e875 Merge release-20190806.1-374-gd0d89ce (automated) 2019-11-06 18:47:55 +00:00
Ghanan Gowripalan d0d89ceedd Send a TCP RST in response to a TCP SYN-ACK on a listening endpoint
This change better follows what is outlined in RFC 793 section 3.4 figure 12
where a listening socket should not accept a SYN-ACK segment in response to a
(potentially) old SYN segment.

Tests: Test that checks the TCP RST segment sent in response to a TCP SYN-ACK
segment received on a listening TCP endpoint.
PiperOrigin-RevId: 278893114
2019-11-06 10:44:20 -08:00
gVisor bot 9c1f9459ba Merge release-20190806.1-373-ga824b48 (automated) 2019-11-06 18:41:38 +00:00
Ghanan Gowripalan a824b48cea Validate incoming NDP Router Advertisements, as per RFC 4861 section 6.1.2
This change validates incoming NDP Router Advertisements as per RFC 4861 section
6.1.2. It also includes the skeleton to handle Router Advertiements that arrive
on some NIC.

Tests: Unittest to make sure only valid NDP Router Advertisements are received/
not dropped.
PiperOrigin-RevId: 278891972
2019-11-06 10:39:29 -08:00
gVisor bot 5dc53b3a4e Merge release-20190806.1-372-g57f6dbc (automated) 2019-11-06 01:08:13 +00:00
Andrei Vagin 57f6dbc4be test/root: check that memory accouting works as expected
PiperOrigin-RevId: 278739427
2019-11-05 17:03:41 -08:00
gVisor bot 0e3dda38a6 Merge release-20190806.1-371-ge904823 (automated) 2019-11-05 23:18:13 +00:00
Adin Scannell e904823833 Fix repository build scripts.
This fixes a number of issues with the repository build process:

 * Fix the overall structure of the repository.
 * Fix the debian package description.
 * Fix the broken version number for packages.
 * Update the digest algorithm used for signing the release.

I've validated that installation works from a separate staging bucket.

Updates #852

PiperOrigin-RevId: 278716914
2019-11-05 15:16:04 -08:00
gVisor bot 84fea4c5f3 Merge release-20190806.1-370-g493334f (automated) 2019-11-05 00:04:27 +00:00
Andrei Vagin 493334f8b5 kokoro: run KVM syscall tests
We don't know how stable they are, so let's start with warning.

PiperOrigin-RevId: 278484186
2019-11-04 16:00:34 -08:00
gVisor bot 5011b8fa41 Merge release-20190806.1-369-g1e21496 (automated) 2019-11-04 19:30:25 +00:00
Nicolas Lacasse 1e21496e95 Bump rules_go to v0.20.2 and go toolchain to v1.13.4.
PiperOrigin-RevId: 278424814
2019-11-04 11:27:57 -08:00
gVisor bot 40e8158c9c Merge release-20190806.1-368-g4fdd69d (automated) 2019-11-04 19:01:00 +00:00
Kevin Krakauer 4fdd69d681 Check that a file is a regular file with open(O_TRUNC).
It was possible to panic the sentry by opening a cache revalidating folder with
O_TRUNC|O_CREAT.

PiperOrigin-RevId: 278417533
2019-11-04 10:58:29 -08:00
gVisor bot ee17c270cc Merge release-20190806.1-367-gb23b36e (automated) 2019-11-04 18:12:19 +00:00
Michael Pratt b23b36e701 Add NETLINK_KOBJECT_UEVENT socket support
NETLINK_KOBJECT_UEVENT sockets send udev-style messages for device events.
gVisor doesn't have any device events, so our sockets don't need to do anything
once created.

systemd's device manager needs to be able to create one of these sockets. It
also wants to install a BPF filter on the socket. Since we'll never send any
messages, the filter would never be invoked, thus we just fake it out.

Fixes #1117
Updates #1119

PiperOrigin-RevId: 278405893
2019-11-04 10:07:52 -08:00
gVisor bot 909b8159d6 Merge release-20190806.1-366-g3b4f544 (automated) 2019-11-04 17:59:58 +00:00
Michael Pratt 3b4f5445d0 Update membarrier bug
Updates #267

PiperOrigin-RevId: 278402684
2019-11-04 09:55:30 -08:00
gVisor bot 758682e7c9 Merge release-20190806.1-365-g802a3b3 (automated) 2019-11-02 00:51:14 +00:00
gVisor bot 802a3b3bd0 Merge pull request #1109 from xiaobo55x:fsgofer
PiperOrigin-RevId: 278032567
2019-11-01 17:37:07 -07:00
gVisor bot 0e577bb6f8 Merge release-20190806.1-363-g515fee5 (automated) 2019-11-01 19:48:00 +00:00
Michael Pratt 515fee5b6d Add SO_PASSCRED support to netlink sockets
Since we only supporting sending messages from the kernel, the peer is always
the kernel, simplifying handling.

There are currently no known users of SO_PASSCRED that would actually receive
messages from gVisor, but adding full support is barely more work than stubbing
out fake support.

Updates #1117
Fixes #1119

PiperOrigin-RevId: 277981465
2019-11-01 12:45:11 -07:00
gVisor bot 4864ea47cc Merge release-20190806.1-362-g2a709a1 (automated) 2019-11-01 18:57:13 +00:00
Nicolas Lacasse 2a709a1b7b Add "manual" tag back to runtime tests.
PiperOrigin-RevId: 277971910
2019-11-01 11:53:47 -07:00
gVisor bot b31a97c176 Merge release-20190806.1-361-ge70f286 (automated) 2019-11-01 18:52:22 +00:00
Nicolas Lacasse e70f28664a Allow the watchdog to detect when the sandbox is stuck during setup.
The watchdog currently can find stuck tasks, but has no way to tell if the
sandbox is stuck before the application starts executing.

This CL adds a startup timeout and action to the watchdog. If Start() is not
called before the given timeout (if non-zero), then the watchdog will take the
action.

PiperOrigin-RevId: 277970577
2019-11-01 11:49:31 -07:00
gVisor bot e7f30113e2 Merge release-20190806.1-360-g5694bd0 (automated) 2019-11-01 18:47:47 +00:00
Jamie Liu 5694bd080e Don't log "p9.channel.service: flipcall connection shutdown".
This gets quite spammy, especially in tests.

PiperOrigin-RevId: 277970468
2019-11-01 11:45:02 -07:00
gVisor bot 3e21d5a619 Merge release-20190806.1-359-gaf6af2c (automated) 2019-11-01 18:26:16 +00:00
Andrei Vagin af6af2c341 tests: don't use ASSERT_THAT after fork
PiperOrigin-RevId: 277965624
2019-11-01 11:22:21 -07:00
gVisor bot 5c672eed64 Merge release-20190806.1-358-ga99d347 (automated) 2019-11-01 01:07:14 +00:00
Adin Scannell a99d3479a8 Add context to state.
PiperOrigin-RevId: 277840416
2019-10-31 18:03:24 -07:00
gVisor bot b8e50d110e Merge release-20190806.1-357-g36837c4 (automated) 2019-11-01 00:43:02 +00:00
Ian Lewis 36837c4ad3 Add systemd-cgroup flag option.
Adds a systemd-cgroup flag option that prints an error letting the user know
that systemd cgroups are not supported and points them to the relevant issue.

Issue #193

PiperOrigin-RevId: 277837162
2019-10-31 17:39:06 -07:00
gVisor bot c78dae54ad Merge release-20190806.1-356-gfe2e076 (automated) 2019-10-31 19:55:42 +00:00
Adin Scannell fe2e0764ac Add LICENSE and AUTHORS to the go branch.
Also, construct the README directly so that edits can be made.

PiperOrigin-RevId: 277782095
2019-10-31 12:53:27 -07:00
gVisor bot b88a2a3893 Merge release-20190806.1-355-gf7dbdda (automated) 2019-10-31 19:33:22 +00:00
Andrei Vagin f7dbddaf77 platform/kvm: calll sigtimedwait with zero timeout
sigtimedwait is used to check pending signals and
it should not block.

PiperOrigin-RevId: 277777269
2019-10-31 12:29:04 -07:00
gVisor bot 6ca0651993 Merge release-20190806.1-354-g7dcfcd5 (automated) 2019-10-31 18:32:16 +00:00
Brad Burlage 7dcfcd53e4 Fix overloaded use of $RUNTIME.
Turns out we use $RUNTIME in scripts/common.sh to give a name to the runsc
runtime used by the tests.

PiperOrigin-RevId: 277764383
2019-10-31 11:28:18 -07:00