Commit Graph

2484 Commits

Author SHA1 Message Date
gVisor bot e69720f376 Merge release-20191104.0-41-g9ca15db (automated) 2019-11-14 22:10:06 +00:00
Jamie Liu 9ca15dbf14 Avoid unnecessary slice allocation in usermem.BytesIO.blocksFromAddrRanges().
PiperOrigin-RevId: 280507239
2019-11-14 14:04:58 -08:00
gVisor bot aac22c4734 Merge release-20191104.0-40-g3f7d937 (automated) 2019-11-14 18:19:35 +00:00
Kevin Krakauer 3f7d937090 Use PacketBuffers for outgoing packets.
PiperOrigin-RevId: 280455453
2019-11-14 10:15:38 -08:00
gVisor bot f92854de80 Merge release-20191104.0-39-g1e55eb3 (automated) 2019-11-13 23:52:59 +00:00
Andrei Vagin 1e55eb3800 test/syscalls/proc: check an return code of waitid
PiperOrigin-RevId: 280295208
2019-11-13 15:48:12 -08:00
gVisor bot 34250c3027 Merge release-20191104.0-38-g6dd4c9e (automated) 2019-11-13 22:44:33 +00:00
Bhasker Hariharan 6dd4c9ee74 Fix flaky behaviour during S/R.
PiperOrigin-RevId: 280280156
2019-11-13 14:40:08 -08:00
gVisor bot d3e8279217 Merge release-20191104.0-37-g683e879 (automated) 2019-11-13 21:25:46 +00:00
Jay Zhuang 683e8798ab Extract linux-specific test setup to separate file
PiperOrigin-RevId: 280264564
2019-11-13 13:21:50 -08:00
gVisor bot d1aaccdccc Merge release-20191104.0-36-gc2d3dc0 (automated) 2019-11-13 07:05:39 +00:00
Nicolas Lacasse c2d3dc0c13 Use overlay MountSource when binding socket in overlay.
PiperOrigin-RevId: 280131840
2019-11-12 23:01:47 -08:00
Haibo Xu 1d8b7292d7 Fix some build errors on arm64.
Initialize the VDSO "os" and "arch" fields explicitly,
or the VDSO load process would failed on arm64 platform.

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Ic6768df88e43cd7c7956eb630511672ae11ac52f
2019-11-13 06:46:02 +00:00
Haibo Xu c5d9b5b881 Enable sentry/fs/host support on arm64.
newfstatat() syscall is not supported on arm64, so we resort
to use the fstatat() syscall.

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Iea95550ea53bcf85c01f7b3b95da70ad0952177d
2019-11-13 06:46:02 +00:00
Haibo Xu 05871a1cdc Enable runsc/boot support on arm64.
This patch also include a minor change to replace syscall.Dup2
with syscall.Dup3 which was missed in a previous commit(ref a25a976).

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I00beb9cc492e44c762ebaa3750201c63c1f7c2f3
2019-11-13 06:39:11 +00:00
gVisor bot 5e019932cd Merge release-20191104.0-35-g2c6c9af (automated) 2019-11-13 04:41:24 +00:00
Ian Gudger 2c6c9af904 Add UDP SO_REUSEADDR/SO_REUSEPORT conversion tests.
Add additional tests for UDP SO_REUSEADDR and SO_REUSEPORT interaction.

If all existing all currently bound sockets as well as the current binding
socket have SO_REUSEADDR, or if all existing all currently bound sockets as
well as the current binding socket have SO_REUSEPORT, binding a currently bound
address is allowed. This seems odd since it means that the
SO_REUSEADDR/SO_REUSEPORT behavior can change with the binding of additional
sockets.

PiperOrigin-RevId: 280116163
2019-11-12 20:39:04 -08:00
gVisor bot 6de4dfdd28 Merge release-20191104.0-34-gca9cba6 (automated) 2019-11-13 00:02:23 +00:00
Andrei Vagin ca9cba66d2 seccomp: introduce the GreaterThan rule type
PiperOrigin-RevId: 280075805
2019-11-12 15:59:59 -08:00
gVisor bot e012c54350 Merge release-20191104.0-33-g3f51bef (automated) 2019-11-12 23:54:09 +00:00
Ghanan Gowripalan 3f51bef8cd Do not handle TCP packets that include a non-unicast IP address
This change drops TCP packets with a non-unicast IP address as the source or
destination address as TCP is meant for communication between two endpoints.

Test: Make sure that if the source or destination address contains a non-unicast
address, no TCP packet is sent in response and the packet is dropped.
PiperOrigin-RevId: 280073731
2019-11-12 15:50:02 -08:00
gVisor bot 6b9a246eaf Merge release-20190806.1-397-g5398530 (automated) 2019-11-12 22:14:04 +00:00
Ghanan Gowripalan 5398530e45 Discover on-link prefixes from Router Advertisements' Prefix Information options
This change allows the netstack to do NDP's Prefix Discovery as outlined by
RFC 4861 section 6.3.4. If configured to do so, when a new on-link prefix is
discovered, the routing table will be updated with a device route through
the nic the RA arrived at. Likewise, when such a prefix gets invalidated, the
device route will be removed.

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 Prefix Discovery
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 Prefix Discovery, all available under NDPConfigurations:
- HandleRAs: Whether or not NDP RAs are processes
- DiscoverOnLinkPrefixes: Whether or not Prefix Discovery is performed (new)

Another note: for a NIC to process Prefix Information options (in 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 (and by extension the Prefix
Information options) will be processed.

Tests: Unittest to make sure that Prefix Discovery and updates to the routing
table only occur if explicitly configured to do so. Unittest to make sure at
max stack.MaxDiscoveredOnLinkPrefixes discovered on-link prefixes are
remembered.
PiperOrigin-RevId: 280049278
2019-11-12 14:09:43 -08:00
gVisor bot 9644444fd0 Merge release-20190806.1-396-g57a2a5e (automated) 2019-11-12 22:07:56 +00:00
Ian Gudger 57a2a5ea33 Add tests for SO_REUSEADDR and SO_REUSEPORT.
* Basic tests for the SO_REUSEADDR and SO_REUSEPORT options.
* SO_REUSEADDR functional tests for TCP and UDP.
* SO_REUSEADDR and SO_REUSEPORT interaction tests for UDP.
* Stubbed support for UDP getsockopt(SO_REUSEADDR).

PiperOrigin-RevId: 280049265
2019-11-12 14:04:14 -08:00
gVisor bot fd8439d55f Merge release-20190806.1-395-g548d65b (automated) 2019-11-12 20:05:47 +00:00
Andrei Vagin 548d65b2b6 kokoro: correct a path to outputs.zip
PiperOrigin-RevId: 280021914
2019-11-12 12:01:37 -08:00
gVisor bot cdab6070ea Merge release-20190806.1-394-gb82bd24 (automated) 2019-11-12 02:38:04 +00:00
Ian Gudger b82bd24f94 Update ephemeral port reservation tests.
The existing tests which are disabled on gVisor are failing because we default
to SO_REUSEADDR being enabled for TCP sockets. Update the test comments.

Also add new tests for enabled SO_REUSEADDR.

PiperOrigin-RevId: 279862275
2019-11-11 18:35:48 -08:00
gVisor bot c0385be261 Merge release-20190806.1-393-g07f9041 (automated) 2019-11-12 00:38:05 +00:00
gVisor bot 07f9041187 Merge pull request #918 from lubinszARM:pr_ring0
PiperOrigin-RevId: 279840214
2019-11-11 16:15:12 -08:00
gVisor bot bb643cc956 Merge release-20190806.1-391-g2b0e4dc (automated) 2019-11-11 23:53:19 +00:00
Bhasker Hariharan 2b0e4dc6aa Remove obsolete TODO. This is now fixed.
PiperOrigin-RevId: 279835100
2019-11-11 15:51:10 -08:00
gVisor bot a660e87c4e Merge release-20190806.1-390-ge09e7bf (automated) 2019-11-11 22:46:12 +00:00
Brad Burlage e09e7bf72f Add more extended features.
PiperOrigin-RevId: 279820435
2019-11-11 14:42:57 -08:00
gVisor bot 8b57622c97 Merge release-20190806.1-389-g7730716 (automated) 2019-11-11 22:19:40 +00:00
gVisor bot 7730716800 Make `connect` on socket returned by `accept` correctly error out with EISCONN
PiperOrigin-RevId: 279814493
2019-11-11 14:15:06 -08:00
gVisor bot 6fe396ec20 Merge release-20190806.1-388-g833dbba (automated) 2019-11-09 02:14:20 +00:00
gVisor bot 833dbba70d Merge pull request #1158 from andrew-d:andrew/rules-go
PiperOrigin-RevId: 279425005
2019-11-08 18:11:55 -08:00
gVisor bot 43d2f5ea22 Merge release-20190806.1-386-gb91ad8f (automated) 2019-11-09 00:44:40 +00:00
Andrei Vagin b91ad8fa09 test: merge log files of all shards for each test suite
This significantly speeds up a process of uploading this files
to sponge and resultstore by kokoro.

PiperOrigin-RevId: 279416349
2019-11-08 16:40:51 -08:00
gVisor bot 66a47bb116 Merge release-20190806.1-385-g14f4461 (automated) 2019-11-08 23:49:24 +00:00
Andrei Vagin 14f4461f93 kokoro: update images to install zip
PiperOrigin-RevId: 279406266
2019-11-08 15:45:16 -08:00
gVisor bot 4cb58888fa Merge release-20190806.1-384-g50d6236 (automated) 2019-11-08 22:13:41 +00:00
Andrei Vagin 50d6236111 Update kokoro images to install junitparser
junitparser will be used to merge junit xml files.

PiperOrigin-RevId: 279387305
2019-11-08 14:08:54 -08:00
gVisor bot 759da51175 Merge release-20190806.1-383-gaf58a4e (automated) 2019-11-08 20:24:38 +00:00
Kevin Krakauer af58a4e3bb Automated rollback of changelist 278417533
PiperOrigin-RevId: 279365629
2019-11-08 12:20:11 -08:00
Andrew Dunham d2df9d76eb Bump gazelle to v0.19.1 2019-11-07 22:19:33 -08:00
gVisor bot 6e114e15c6 Merge release-20190806.1-382-g66ebb65 (automated) 2019-11-07 17:50:46 +00:00
Bhasker Hariharan 66ebb6575f Add support for TIME_WAIT timeout.
This change adds explicit support for honoring the 2MSL timeout
for sockets in TIME_WAIT state. It also adds support for the
TCP_LINGER2 option that allows modification of the FIN_WAIT2
state timeout duration for a given socket.

It also adds an option to modify the Stack wide TIME_WAIT timeout
but this is only for testing. On Linux this is fixed at 60s.

Further, we also now correctly process RST's in CLOSE_WAIT and
close the socket similar to linux without moving it to error
state.

We also now handle SYN in ESTABLISHED state as per
RFC5961#section-4.1. Earlier we would just drop these SYNs.
Which can result in some tests that pass on linux to fail on
gVisor.

Netstack now honors TIME_WAIT correctly as well as handles the
following cases correctly.

- TCP RSTs in TIME_WAIT are ignored.
- A duplicate TCP FIN during TIME_WAIT extends the TIME_WAIT
  and a dup ACK is sent in response to the FIN as the dup FIN
  indicates potential loss of the original final ACK.
- An out of order segment during TIME_WAIT generates a dup ACK.
- A new SYN w/ a sequence number > the highest sequence number
  in the previous connection closes the TIME_WAIT early and
  opens a new connection.

Further to make the SYN case work correctly the ISN (Initial
Sequence Number) generation for Netstack has been updated to
be as per RFC. Its not a pure random number anymore and follows
the recommendation in https://tools.ietf.org/html/rfc6528#page-3.

The current hash used is not a cryptographically secure hash
function. A separate change will update the hash function used
to Siphash similar to what is used in Linux.

PiperOrigin-RevId: 279106406
2019-11-07 09:46:55 -08:00