Commit Graph

5456 Commits

Author SHA1 Message Date
gVisor bot 7c81294c74 Merge release-20210315.0-23-ge7ca2a51a (automated) 2021-03-24 19:17:38 +00:00
Bhasker Hariharan e7ca2a51a8 Add POLLRDNORM/POLLWRNORM support.
On Linux these are meant to be equivalent to POLLIN/POLLOUT. Rather
than hack these on in sys_poll etc it felt cleaner to just cleanup
the call sites to notify for both events. This is what linux does
as well.

Fixes #5544

PiperOrigin-RevId: 364859977
2021-03-24 12:11:44 -07:00
Bhasker Hariharan 72ff6a1cac Fix data race in fdbased when accessing fanoutID.
PiperOrigin-RevId: 364859173
2021-03-24 12:07:10 -07:00
gVisor bot 9662600f3f Merge release-20210315.0-21-gec0aa657e (automated) 2021-03-24 16:44:16 +00:00
Nick Brown ec0aa657ed Unexpose immutable fields in stack.Route
This change sets the inner `routeInfo` struct to be a named private member
and replaces direct access with access through getters. Note that direct
access to the fields of `routeInfo` is still possible through the `RouteInfo`
struct.

Fixes #4902

PiperOrigin-RevId: 364822872
2021-03-24 09:38:27 -07:00
gVisor bot 15bcc00b79 Merge release-20210315.0-20-g8ee4a3f6d (automated) 2021-03-24 05:56:09 +00:00
gVisor bot 8ee4a3f6d0 Merge pull request #5677 from avagin:kvm-mmio
PiperOrigin-RevId: 364728696
2021-03-23 22:50:14 -07:00
gVisor bot 6d6d1361a8 Merge release-20210315.0-18-g56a9a1397 (automated) 2021-03-24 01:53:34 +00:00
Andrei Vagin 56a9a13976 Move the code that manages floating-point state to a separate package
This change is inspired by Adin's cl/355256448.

PiperOrigin-RevId: 364695931
2021-03-23 18:46:37 -07:00
gVisor bot 36211dedcc Merge release-20210315.0-16-g92374e519 (automated) 2021-03-23 22:57:57 +00:00
Kevin Krakauer 92374e5197 setgid directory support in goferfs
Also adds support for clearing the setuid bit when appropriate (writing,
truncating, changing size, changing UID, or changing GID).

VFS2 only.

PiperOrigin-RevId: 364661835
2021-03-23 15:42:12 -07:00
gVisor bot e48ad2ada0 Merge release-20210315.0-15-gacb4c6288 (automated) 2021-03-23 19:03:20 +00:00
Nayana Bidari dc75f08c2a Use constant (TestInitialSequenceNumber) instead of integer (789) in tests.
PiperOrigin-RevId: 364596526
2021-03-23 10:59:57 -07:00
gVisor bot b815e8d38a Merge release-20210315.0-11-g409a11445 (automated) 2021-03-23 17:03:14 +00:00
Ghanan Gowripalan 409a114454 Explicitly allow martian loopback packets
...instead of opting out of them.

Loopback traffic should be stack-local but gVisor has some clients
that depend on the ability to receive loopback traffic that originated
from outside of the stack. Because of this, we guard this change behind
IP protocol options.

A previous change provided the facility to deny these martian loopback
packets but this change requires client to opt-in to accepting martian
loopback packets as accepting martian loopback packets are not meant
to be accepted, as per RFC 1122 section 3.2.1.3.g:

        (g)  { 127, <any> }

             Internal host loopback address.  Addresses of this form
             MUST NOT appear outside a host.

PiperOrigin-RevId: 364581174
2021-03-23 09:57:01 -07:00
gVisor bot 2ed67c04a4 Merge release-20210315.0-9-gc0bd71c5a (automated) 2021-03-23 02:22:53 +00:00
Zeling Feng 9e86dfc9c5 Fix logs for packetimpact tests cleanup
- Don't cleanup containers in Network.Cleanup, otherwise containers will
  be killed and removed several times.
- Don't set AutoRemove for containers. This will prevent the confusing
  'removal already in progress' messages.

Fixes #3795

PiperOrigin-RevId: 364404414
2021-03-22 14:10:00 -07:00
gVisor bot 16def91ab4 Merge release-20210315.0-7-ga073d7697 (automated) 2021-03-22 19:36:16 +00:00
Ghanan Gowripalan a073d76979 Return tcpip.Error from (*Stack).GetMainNICAddress
PiperOrigin-RevId: 364381970
2021-03-22 12:31:46 -07:00
gVisor bot 1da1290bfb Merge release-20210315.0-6-g6bd2c6ce7 (automated) 2021-03-22 19:07:41 +00:00
gVisor bot eb11764fbf Merge release-20210315.0-5-gb428fd02e (automated) 2021-03-22 18:50:51 +00:00
Nicolas Lacasse b428fd02e6 Avoid calling sync on each write in writethrough mode.
PiperOrigin-RevId: 364370595
2021-03-22 11:44:31 -07:00
gVisor bot b6af86bbc2 Merge release-20210309.0-41-g7fac7e32f (automated) 2021-03-18 19:25:33 +00:00
Fabricio Voznika 7fac7e32f3 Translate syserror when validating partial IO errors
syserror allows packages to register translators for errors. These
translators should be called prior to checking if the error is valid,
otherwise it may not account for possible errors that can be returned
from different packages, e.g. safecopy.BusError => syserror.EFAULT.

Second attempt, it passes tests now :-)

PiperOrigin-RevId: 363714508
2021-03-18 12:19:57 -07:00
Ghanan Gowripalan d3a433caae Do not use martian loopback packets in tests
Transport demuxer and UDP tests should not use a loopback address as the
source address for packets injected into the stack as martian loopback
packets will be dropped in a later change.

PiperOrigin-RevId: 363479681
2021-03-17 12:29:08 -07:00
gVisor bot 8b9d674f58 Merge release-20210309.0-37-g4065604e1 (automated) 2021-03-17 18:22:30 +00:00
Ghanan Gowripalan 4065604e1b Drop loopback traffic from outside of the stack
Loopback traffic should be stack-local but gVisor has some clients
that depend on the ability to receive loopback traffic that originated
from outside of the stack. Because of this, we guard this change behind
IP protocol options.

Test: integration_test.TestExternalLoopbackTraffic
PiperOrigin-RevId: 363461242
2021-03-17 11:12:06 -07:00
Andrei Vagin 2f3dac78ca kvm: prefault a floating point state before restoring it
If physical pages of a memory region are not mapped yet, the kernel will
trigger KVM_EXIT_MMIO and we will map physical pages in bluepillHandler().

An instruction that triggered a fault will not be re-executed, it
will be emulated in the kernel, but it can't  emulate complex
instructions like xsave, xrstor. We can touch the memory with
simple instructions to workaround this problem.
2021-03-16 21:55:20 -07:00
gVisor bot 93ab0c0426 Merge release-20210309.0-36-g3dd7ad13b (automated) 2021-03-17 00:03:37 +00:00
Zeling Feng 3dd7ad13b4 Fix tcp_fin_retransmission_netstack_test
Netstack does not check ACK number for FIN-ACK packets and goes into TIMEWAIT
unconditionally. Fixing the state machine will give us back the retransmission
of FIN.

PiperOrigin-RevId: 363301883
2021-03-16 16:59:26 -07:00
gVisor bot 25ad40d950 Merge release-20210309.0-35-g5eede4e75 (automated) 2021-03-16 22:13:06 +00:00
Mithun Iyer 5eede4e756 Fix a race with synRcvdCount and accept
There is a race in handling new incoming connections on a listening
endpoint that causes the endpoint to reply to more incoming SYNs than
what is permitted by the listen backlog.

The race occurs when there is a successful passive connection handshake
and the synRcvdCount counter is decremented, followed by the endpoint
delivered to the accept queue. In the window of time between
synRcvdCount decrementing and the endpoint being enqueued for accept,
new incoming SYNs can be handled without honoring the listen backlog
value, as the backlog could be perceived not full.

Fixes #5637

PiperOrigin-RevId: 363279372
2021-03-16 15:08:09 -07:00
gVisor bot c9a030e8e9 Merge release-20210309.0-34-g607a1e481 (automated) 2021-03-16 22:00:36 +00:00
Kevin Krakauer 607a1e481c setgid directory support in overlayfs
PiperOrigin-RevId: 363276495
2021-03-16 14:55:29 -07:00
gVisor bot 364e952de5 Merge release-20210309.0-33-g05193de1c (automated) 2021-03-16 19:10:11 +00:00
Ghanan Gowripalan 05193de1cc Unexport methods on NDPOption
They are not used outside of the header package.

PiperOrigin-RevId: 363237708
2021-03-16 12:04:52 -07:00
gVisor bot fc371b3b4d Merge release-20210309.0-32-g68065d1ce (automated) 2021-03-16 18:14:32 +00:00
Ghanan Gowripalan 68065d1ceb Detect looped-back NDP DAD messages
...as per RFC 7527.

If a looped-back DAD message is received, do not fail DAD since our own
DAD message does not indicate that a neighbor has the address assigned.

Test: ndp_test.TestDADResolveLoopback
PiperOrigin-RevId: 363224288
2021-03-16 11:09:26 -07:00
gVisor bot 8663fa59e7 Merge release-20210309.0-31-gebd7c1b88 (automated) 2021-03-16 17:34:27 +00:00
Ghanan Gowripalan ebd7c1b889 Do not call into Stack from LinkAddressRequest
Calling into the stack from LinkAddressRequest is not needed as we
already have a reference to the network endpoint (IPv6) or network
interface (IPv4/ARP).

PiperOrigin-RevId: 363213973
2021-03-16 10:29:49 -07:00
gVisor bot 34cc37e563 Merge release-20210309.0-30-gf7e841c2c (automated) 2021-03-16 03:21:47 +00:00
Etienne Perot f7e841c2ce Turn sys_thread constants into variables.
PiperOrigin-RevId: 363092268
2021-03-15 20:16:48 -07:00
gVisor bot f2dd5f6a5f Merge release-20210309.0-29-gf4b742182 (automated) 2021-03-16 03:15:55 +00:00
Etienne Perot f4b7421820 Move `MaxIovs` back to a variable in `iovec.go`.
PiperOrigin-RevId: 363091954
2021-03-15 20:11:41 -07:00
gVisor bot 3020952019 Merge release-20210309.0-27-gb1d578772 (automated) 2021-03-16 01:55:27 +00:00
Kevin Krakauer b1d5787726 Make netstack (//pkg/tcpip) buildable for 32 bit
Doing so involved breaking dependencies between //pkg/tcpip and the rest
of gVisor, which are discouraged anyways.

Tested on the Go branch via:
  gvisor.dev/gvisor/pkg/tcpip/...

Addresses #1446.

PiperOrigin-RevId: 363081778
2021-03-15 18:49:59 -07:00
gVisor bot ed21cec720 Merge release-20210309.0-26-gec45d9692 (automated) 2021-03-15 23:52:36 +00:00
Ayush Ranjan ec45d96923 [op] Make gofer client handle return partial write length when err is nil.
If there was a partial write (when not using the host FD) which did not generate
an error, we were incorrectly returning the number of bytes attempted to write
instead of the number of bytes actually written.

PiperOrigin-RevId: 363058989
2021-03-15 16:41:02 -07:00
gVisor bot 7ac52482a3 Merge release-20210309.0-25-g48915d17d (automated) 2021-03-15 19:20:55 +00:00
gVisor bot 48915d17df Merge pull request #5618 from iangudger:unix-transport-race
PiperOrigin-RevId: 362999220
2021-03-15 12:16:07 -07:00