Commit Graph

2229 Commits

Author SHA1 Message Date
gVisor bot 8345862af1 Merge release-20190806.1-297-g0b569b7 (automated) 2019-10-21 21:59:17 +00:00
Dean Deng 0b569b7cae Add basic implementation of execveat syscall and associated tests.
Allow file descriptors of directories as well as AT_FDCWD.

PiperOrigin-RevId: 275929668
2019-10-21 14:55:18 -07:00
gVisor bot b0dbb71b3d Merge release-20190806.1-296-ga9358ce (automated) 2019-10-21 20:33:57 +00:00
Nicolas Lacasse a9358ce81f Bump rules_go to v0.20.1 and go toolchain to v1.13.3.
PiperOrigin-RevId: 275909782
2019-10-21 13:28:17 -07:00
gVisor bot 975132cced Merge release-20190806.1-295-g12235d5 (automated) 2019-10-21 20:26:03 +00:00
Kevin Krakauer 12235d533a AF_PACKET support for netstack (aka epsocket).
Like (AF_INET, SOCK_RAW) sockets, AF_PACKET sockets require CAP_NET_RAW. With
runsc, you'll need to pass `--net-raw=true` to enable them.

Binding isn't supported yet.

PiperOrigin-RevId: 275909366
2019-10-21 13:23:18 -07:00
gVisor bot 17a63aa158 Merge release-20190806.1-294-g652f7b1 (automated) 2019-10-19 18:53:34 +00:00
Kevin Krakauer 652f7b1d0f Add support for pipes in VFS2.
PiperOrigin-RevId: 275650307
2019-10-19 11:49:38 -07:00
gVisor bot 5b34eb4ff9 Merge release-20190806.1-293-g74044f2 (automated) 2019-10-18 23:22:29 +00:00
Fabricio Voznika 74044f2cca Add more instructions to test/README.md
PiperOrigin-RevId: 275565958
2019-10-18 16:18:52 -07:00
gVisor bot 9fe1139c23 Merge release-20190806.1-292-g51538c9 (automated) 2019-10-18 23:17:23 +00:00
Tamir Duberstein 51538c973e Store primary endpoints in a slice
There's no need for a linked list here.

PiperOrigin-RevId: 275565920
2019-10-18 16:14:09 -07:00
gVisor bot a26c9cf0f7 Merge release-20190806.1-291-g487d3b2 (automated) 2019-10-18 23:04:14 +00:00
Mithun Iyer 487d3b2358 Fix typo while initializing protocol for UDP endpoints.
Fixes #763

PiperOrigin-RevId: 275563222
2019-10-18 16:00:11 -07:00
gVisor bot 2345121074 Merge release-20190806.1-290-g49b596b (automated) 2019-10-18 22:36:50 +00:00
Michael Pratt 49b596b98d Cleanup host UDS support
This change fixes several issues with the fsgofer host UDS support. Notably, it
adds support for SOCK_SEQPACKET and SOCK_DGRAM sockets [1]. It also fixes
unsafe use of unet.Socket, which could cause a panic if Socket.FD is called
when err != nil, and calls to Socket.FD with nothing to prevent the garbage
collector from destroying and closing the socket.

A set of tests is added to exercise host UDS access. This required extracting
most of the syscall test runner into a library that can be used by custom
tests.

Updates #235
Updates #1003

[1] N.B. SOCK_DGRAM sockets are likely not particularly useful, as a server can
only reply to a client that binds first. We don't allow bind, so these are
unlikely to be used.

PiperOrigin-RevId: 275558502
2019-10-18 15:33:03 -07:00
gVisor bot 28ce28fd28 Merge release-20190806.1-289-g8ae70f8 (automated) 2019-10-18 22:05:27 +00:00
Andrei Vagin 8ae70f864d test/perf: optimize the getdents test
* Use mknod instead of open&close to create an empty file.
* Limit a number of files to (1<<16) instead of 100K.

In this case, a test set is (1, 8, 64, 512, 4K, 32K, 64K) instead of (1, 8, 64,
512, 4K, 32K, 98K). I think it is easier to compare results for 32K and 64K
than 32K and 98K. And results for 98K doesn't give us more information than for
54K.

PiperOrigin-RevId: 275552507
2019-10-18 15:01:40 -07:00
gVisor bot 6ca306246c Merge release-20190806.1-288-g4e6f3a0 (automated) 2019-10-18 21:14:32 +00:00
Tamir Duberstein 4e6f3a0c71 Remove restrictions on the sending address
It is quite legal to send from the ANY address (it is required for
DHCP). I can't figure out why the broadcast address was included here,
so removing that as well.

PiperOrigin-RevId: 275541954
2019-10-18 14:10:30 -07:00
gVisor bot ab5d3180b0 Merge release-20190806.1-287-g4c7f849 (automated) 2019-10-18 20:42:49 +00:00
Andrei Vagin 4c7f849b25 test: use a bigger buffer to fill a socket
Otherwise we need to do a lot of system calls and cooperative_save tests work
slow.

PiperOrigin-RevId: 275536957
2019-10-18 13:40:31 -07:00
gVisor bot 909674bfb2 Merge release-20190806.1-286-gdfdbdf1 (automated) 2019-10-17 20:13:53 +00:00
Kevin Krakauer dfdbdf14fa Refactor pipe to support VFS2.
* Pulls common functionality (IO and locking on open) into pipe_util.go.
* Adds pipe/vfs.go, which implements a subset of vfs.FileDescriptionImpl.

A subsequent change will add support for pipes in memfs.

PiperOrigin-RevId: 275322385
2019-10-17 13:11:07 -07:00
gVisor bot fba548ec48 Merge release-20190806.1-285-g962aa23 (automated) 2019-10-17 20:08:43 +00:00
Ghanan Gowripalan 962aa235de NDP Neighbor Solicitations sent during DAD must have an IP hop limit of 255
NDP Neighbor Solicitations sent during Duplicate Address Detection must have an
IP hop limit of 255, as all NDP Neighbor Solicitations should have.

Test: Test that DAD messages have the IPv6 hop limit field set to 255.
PiperOrigin-RevId: 275321680
2019-10-17 13:06:15 -07:00
gVisor bot 1993a36b01 Merge release-20190806.1-284-g06ed9e3 (automated) 2019-10-17 05:58:27 +00:00
Ghanan Gowripalan 06ed9e329d Do Duplicate Address Detection on permanent IPv6 addresses.
This change adds support for Duplicate Address Detection on IPv6 addresses
as defined by RFC 4862 section 5.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 DAD will not be
performed. See `stack.Options` and `stack.NDPConfigurations` for more details.

Tests: Tests to make sure that the DAD process properly resolves or fails.
That is, tests make sure that DAD resolves only if:
  - No other node is performing DAD for the same address
  - No other node owns the same address
PiperOrigin-RevId: 275189471
2019-10-16 22:54:45 -07:00
gVisor bot 61ea1714d2 Merge release-20190806.1-283-g2a82d5a (automated) 2019-10-16 23:44:21 +00:00
Kevin Krakauer 2a82d5ad68 Reorder BUILD license and load functions in gvisor.
PiperOrigin-RevId: 275139066
2019-10-16 16:40:30 -07:00
gVisor bot d5d4cc8e6f Merge release-20190806.1-282-g8fe48dc (automated) 2019-10-16 22:37:09 +00:00
Michael Pratt 8fe48dcb1e Add sublevel to kernel version
Standard Linux kernel versions are VERSION.PATCHLEVEL.SUBLEVEL. e.g., 4.4.0,
even when the sublevel is 0. Match this standard.

PiperOrigin-RevId: 275125715
2019-10-16 15:22:42 -07:00
gVisor bot a02f8d0dbe Merge release-20190806.1-281-g9fb5622 (automated) 2019-10-16 22:20:51 +00:00
gVisor bot d8af87b44f Merge release-20190806.1-280-gfd4e436 (automated) 2019-10-16 22:13:23 +00:00
Fabricio Voznika 9fb562234e Fix problem with open FD when copy up is triggered in overlayfs
Linux kernel before 4.19 doesn't implement a feature that updates
open FD after a file is open for write (and is copied to the upper
layer). Already open FD will continue to read the old file content
until they are reopened. This is especially problematic for gVisor
because it caches open files.

Flag was added to force readonly files to be reopenned when the
same file is open for write. This is only needed if using kernels
prior to 4.19.

Closes #1006

It's difficult to really test this because we never run on tests
on older kernels. I'm adding a test in GKE which uses kernels
with the overlayfs problem for 1.14 and lower.

PiperOrigin-RevId: 275115289
2019-10-16 15:06:24 -07:00
Nicolas Lacasse fd4e436002 Support O_SYNC and O_DSYNC flags.
When any of these flags are set, all writes will trigger a subsequent fsync
call. This behavior already existed for "write-through" mounts.

O_DIRECT is treated as an alias for O_SYNC. Better support coming soon.

PiperOrigin-RevId: 275114392
2019-10-16 15:01:23 -07:00
gVisor bot f5458a2704 Merge release-20190806.1-279-gbbdcf44 (automated) 2019-10-16 22:01:08 +00:00
Michael Pratt bbdcf44ebb Fix syscall changes lost in rebase
These syscalls were changed in the amd64 file around the time the arm64 PR was
sent out, so their changes got lost.

Updates #63

PiperOrigin-RevId: 275114194
2019-10-16 14:56:29 -07:00
gVisor bot cde805cabd Merge release-20190806.1-278-gd22f053 (automated) 2019-10-16 21:54:52 +00:00
gVisor bot d22f0534c0 Merge pull request #736 from tanjianfeng:fix-unix
PiperOrigin-RevId: 275114157
2019-10-16 14:41:43 -07:00
gVisor bot 3151bfa70a Merge release-20190806.1-275-gde9a8e0 (automated) 2019-10-16 20:29:06 +00:00
Michael Pratt de9a8e0eb7 Remove death from exec test names
These aren't actually death tests in the GUnit sense. i.e., they don't call
EXPECT_EXIT or EXPECT_DEATH.

PiperOrigin-RevId: 275099957
2019-10-16 13:25:11 -07:00
gVisor bot 7d1516edbb Merge release-20190806.1-274-g0457a4c (automated) 2019-10-16 01:43:08 +00:00
Jamie Liu 0457a4c4cb Minor vfs.FileDescriptionImpl fixes.
- Pass context.Context to OnClose().

- Pass memmap.MMapOpts to ConfigureMMap() by pointer so that implementations
  can actually mutate it as required.

PiperOrigin-RevId: 274934967
2019-10-15 18:40:45 -07:00
gVisor bot 5dea813288 Merge release-20190806.1-273-gf98c3ee (automated) 2019-10-16 00:07:13 +00:00
Bhasker Hariharan f98c3ee32c Remove panic when reassembly fails.
Reassembly can fail due to an invalid sequence of fragments
being received. eg. Multiple fragments with same id which
claim to be the last one by setting the more flag to 0 etc.
It's safer to just drop the reassembler and increment a metric
than to panic when reassembly fails.

PiperOrigin-RevId: 274920901
2019-10-15 17:04:44 -07:00
gVisor bot 749e21e311 Merge release-20190806.1-272-gdb1ca5c (automated) 2019-10-15 19:47:28 +00:00
Tamir Duberstein db1ca5c786 Set NDP hop limit in accordance with RFC 4861
...and do not populate link address cache at dispatch. This partially
reverts 313c767b00, which caused malformed
packets (e.g. NDP Neighbor Adverts with incorrect hop limit values) to
populate the address cache. In particular, this masked a bug that was
introduced to the Neighbor Advert generation code in
7c1587e340.

PiperOrigin-RevId: 274865182
2019-10-15 12:43:25 -07:00
gVisor bot a163da43cc Merge release-20190806.1-271-ga295616 (automated) 2019-10-15 17:05:15 +00:00
Michael Pratt a295616326 Make Attach no longer a special snowflake
fsgofer.attachPoint.Attach has a bunch of funky special logic to create a RW
file or connect a socket rather than creating a standard control file like
localFile.Walk.

This is unecessary and error-prone, as the attach point still has to go through
Open or Connect which will properly convert the control file to something
usable. As such, switch the logic to be equivalent to a simple Walk.

Updates #235

PiperOrigin-RevId: 274827872
2019-10-15 10:01:22 -07:00