Commit Graph

2457 Commits

Author SHA1 Message Date
gVisor bot bd17bba359 Merge release-20191114.0-16-g012102e (automated) 2019-11-20 23:12:35 +00:00
Nicolas Lacasse 012102eefd Pass OpenTruncate to gofer in Open call when opening file with O_TRUNC.
Note that the Sentry still calls Truncate() on the file before calling Open.

A new p9 version check was added to ensure that the p9 server can handle the
the OpenTruncate flag. If not, then the flag is stripped before sending.

PiperOrigin-RevId: 281609112
2019-11-20 15:07:16 -08:00
gVisor bot a98f44c872 Merge release-20191114.0-15-gef6f936 (automated) 2019-11-19 00:30:13 +00:00
Jamie Liu ef6f936254 Add vfs.GenericParseMountOptions().
Equivalent to fs.GenericMountSourceOptions().

PiperOrigin-RevId: 281179287
2019-11-18 16:26:28 -08:00
gVisor bot 34cd8270b2 Merge release-20191114.0-14-g26b3341 (automated) 2019-11-18 22:58:57 +00:00
Andrei Vagin 26b3341b9a platform/ptrace: use host.GetCPU instead of the getcpu syscall
This should save ~200ns from switchToApp (on ptrace too). // mpratt

PiperOrigin-RevId: 281159895
2019-11-18 14:56:49 -08:00
gVisor bot fb97248393 Merge release-20191114.0-13-g235a96c (automated) 2019-11-18 19:59:51 +00:00
gVisor bot 235a96cab1 Merge pull request #1177 from xiaobo55x:fs_host
PiperOrigin-RevId: 281112758
2019-11-18 11:50:44 -08:00
gVisor bot ac49b282fd Merge release-20191104.0-49-g9601943 (automated) 2019-11-18 19:26:40 +00:00
Adin Scannell 9601943685 release: fix tag script
The tag script, when not run interactively, will fail without a provided commit
message (since it now uses annotated tags). For now, use a trivial message. In
the future, this could be extended to provide automated release notes.

PiperOrigin-RevId: 281112651
2019-11-18 11:22:38 -08:00
gVisor bot ae7795fc13 Merge release-20191104.0-48-g5107e6b (automated) 2019-11-16 00:56:39 +00:00
Bhasker Hariharan 5107e6b6bd Automated rollback of changelist 280594395
PiperOrigin-RevId: 280763655
2019-11-15 16:52:34 -08:00
gVisor bot ba382b592f Merge release-20191104.0-47-g3e534f2 (automated) 2019-11-15 20:22:31 +00:00
Mithun Iyer 3e534f2974 Handle in-flight TCP segments when moving to CLOSE.
As we move to CLOSE state from LAST-ACK or TIME-WAIT,
ensure that we re-match all in-flight segments to any
listening endpoint.

Also fix LISTEN state handling of any ACK segments as per RFC793.

Fixes #1153

PiperOrigin-RevId: 280703556
2019-11-15 12:11:36 -08:00
gVisor bot be58d8f293 Merge release-20191104.0-46-g76039f8 (automated) 2019-11-15 19:48:29 +00:00
Jamie Liu 76039f8959 Do not set finalizer on p9.ClientFile.
Aside from the performance hit, there is no guarantee that p9.ClientFile's
finalizer runs before the associated p9.Client is closed.

PiperOrigin-RevId: 280702509
2019-11-15 11:40:52 -08:00
gVisor bot 91bc96c3e4 Merge release-20191104.0-45-g23574b1 (automated) 2019-11-15 06:57:39 +00:00
Kevin Krakauer 23574b1b87 Fix panic when logging raw packets via sniffer.
Sniffer assumed that outgoing packets have transport headers, but
users can write packets via SOCK_RAW with arbitrary transport headers that
netstack doesn't know about. We now explicitly check for the presence of network
and transport headers before assuming they exist.

PiperOrigin-RevId: 280594395
2019-11-14 22:55:15 -08:00
gVisor bot 2539a555d1 Merge release-20191104.0-44-gaf323eb (automated) 2019-11-15 01:15:23 +00:00
Ting-Yu Wang af323eb7c1 Fix return codes for {get,set}sockopt for some nullptr cases.
Updates #1092

PiperOrigin-RevId: 280547239
2019-11-14 17:04:34 -08:00
gVisor bot d078524540 Merge release-20191104.0-43-g339536d (automated) 2019-11-15 00:21:07 +00:00
Kevin Krakauer 339536de5e 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.

Avoids breaking php tests.

PiperOrigin-RevId: 280533213
2019-11-14 16:08:34 -08:00
gVisor bot 75d810f36b Merge release-20191104.0-42-g1e1f5ce (automated) 2019-11-14 23:15:32 +00:00
Kevin Krakauer 1e1f5ce082 Allow all runtime tests for a language to be run via a single command.
This was intended behavior per the README, but running tests without the --test
flag caused an error. Users can now omit the --test flag to run every test for a
runtime.

PiperOrigin-RevId: 280522025
2019-11-14 15:06:04 -08:00
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
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