Commit Graph

2484 Commits

Author SHA1 Message Date
Ghanan Gowripalan 5a421058a0 Validate the checksum for incoming ICMPv6 packets
This change validates the ICMPv6 checksum field before further processing an
ICMPv6 packet.

Tests: Unittests to make sure that only ICMPv6 packets with a valid checksum
are accepted/processed. Existing tests using checker.ICMPv6 now also check the
ICMPv6 checksum field.
PiperOrigin-RevId: 276779148
2019-10-25 16:06:55 -07:00
gVisor bot e0b0ba4247 Merge release-20190806.1-327-g8f029b3 (automated) 2019-10-25 20:18:16 +00:00
Ian Gudger 8f029b3f82 Convert DelayOption to the newer/faster SockOpt int type.
DelayOption is set on all new endpoints in gVisor.

PiperOrigin-RevId: 276746791
2019-10-25 13:15:34 -07:00
gVisor bot 6dfd0d8aa1 Merge release-20190806.1-326-ge0c84f2 (automated) 2019-10-25 19:44:29 +00:00
Haibo e0c84f284c test/syscall: Remove duplicated gtest/gtest.h.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I05a7ec69b98b88931ba4a8adb3e8a7b822006001
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gvisor/pull/1023 from xiaobo55x:syscall_test d44a8b1f827ed4081997af96cd58ba7449e0a9e1
PiperOrigin-RevId: 276740442
2019-10-25 12:40:36 -07:00
gVisor bot c2a8262f3b Merge release-20190806.1-325-gfd59891 (automated) 2019-10-25 18:22:56 +00:00
Andrei Vagin fd598912be platform/ptrace: use tgkill instead of kill
The syscall filters don't allow kill, just tgkill.

PiperOrigin-RevId: 276718421
2019-10-25 11:19:20 -07:00
gVisor bot 0f55df21b0 Merge release-20190806.1-324-g9a72674 (automated) 2019-10-25 18:14:50 +00:00
gVisor bot 9a726745ee Merge pull request #1070 from lubinszARM:pr_abi
PiperOrigin-RevId: 276609608
2019-10-25 10:59:42 -07:00
gVisor bot d77656f684 Merge release-20190806.1-322-g27e896f (automated) 2019-10-24 23:55:44 +00:00
Ghanan Gowripalan 27e896f290 Add a type to represent the NDP Prefix Information option.
This change is in preparation for NDP Prefix Discovery and SLAAC where the stack
will need to handle NDP Prefix Information options.

Tests: Test that given an NDP Prefix Information option buffer, correct values
are returned by the field getters.
PiperOrigin-RevId: 276594592
2019-10-24 16:53:08 -07:00
gVisor bot f28ef1dc3e Merge release-20190806.1-321-ge8ba10c (automated) 2019-10-24 23:39:08 +00:00
Fabricio Voznika e8ba10c008 Fix early deletion of rootDir
container.startContainers() cannot be called twice in a test
(e.g. TestMultiContainerLoadSandbox) because the cleanup
function deletes the rootDir, together with information from
all other containers that may exist.

PiperOrigin-RevId: 276591806
2019-10-24 16:36:54 -07:00
gVisor bot 9bb07ad908 Merge release-20190806.1-320-ge50a1f5 (automated) 2019-10-24 22:27:24 +00:00
Ghanan Gowripalan e50a1f5739 Remove the amss field from tcpip.tcp.handshake as it was unused
The amss field in the tcpip.tcp.handshake was not used anywhere. Removed it to
not cause confusion with the amss field in the tcpip.tcp.endpoint struct, which
was documented to be used (and is actually being used) for the same purpose.

PiperOrigin-RevId: 276577088
2019-10-24 15:23:43 -07:00
gVisor bot 782033599c Merge release-20190806.1-319-gf034790 (automated) 2019-10-24 18:13:10 +00:00
Ghanan Gowripalan f034790ad8 Use interface-specific NDP configurations instead of the stack-wide default.
This change makes it so that NDP work is done using the per-interface NDP
configurations instead of the stack-wide default NDP configurations to correctly
implement RFC 4861 section 6.3.2 (note here, a host is a single NIC operating
as a host device), and RFC 4862 section 5.1.

Test: Test that we can set NDP configurations on a per-interface basis without
affecting the configurations of other interfaces or the stack-wide default. Also
make sure that after the configurations are updated, the updated configurations
are used for NDP processes (e.g. Duplicate Address Detection).
PiperOrigin-RevId: 276525661
2019-10-24 11:09:18 -07:00
Bin Lu 7f9c391cf1 slight changes to pkg/abi
In glibc, some structures are defined differently on different
platforms.
Such as: C.struct_stat

Signed-off-by: Bin Lu <bin.lu@arm.com>
2019-10-24 09:15:29 +00:00
gVisor bot 370b2fd53e Merge release-20190806.1-318-gd9fd536 (automated) 2019-10-24 08:49:17 +00:00
Dean Deng d9fd536340 Handle AT_SYMLINK_NOFOLLOW flag for execveat.
PiperOrigin-RevId: 276441249
2019-10-24 01:45:25 -07:00
Dean Deng 7ca50236c4 Handle AT_EMPTY_PATH flag in execveat.
PiperOrigin-RevId: 276419967
2019-10-23 22:23:05 -07:00
gVisor bot 0055fc1d18 Merge release-20190806.1-316-g072af49 (automated) 2019-10-24 00:23:27 +00:00
Kevin Krakauer 072af49059 Add check for proper settings to AF_PACKET tests.
As in packet_socket_raw.cc, we should check that certain proc files are set
correctly.

PiperOrigin-RevId: 276384534
2019-10-23 17:21:12 -07:00
gVisor bot 10b2240df3 Merge release-20190806.1-315-g6d4d956 (automated) 2019-10-23 23:59:32 +00:00
gVisor bot 6d4d9564e3 Merge pull request #641 from tanjianfeng:master
PiperOrigin-RevId: 276380008
2019-10-23 16:55:15 -07:00
gVisor bot bdf5354e93 Merge release-20190806.1-309-gfbe6b50 (automated) 2019-10-23 21:41:43 +00:00
DarcySail fbe6b50d56 Keep minimal available fd to accelerate fd allocation
Use fd.next to store the iteration start position, which can be used to accelerate allocating new FDs.
And adding the corresponding gtest benchmark to measure performance.
@tanjianfeng

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gvisor/pull/758 from DarcySail:master 96685ec7886dfe1a64988406831d3bc002b438cc
PiperOrigin-RevId: 276351250
2019-10-23 14:27:53 -07:00
gVisor bot f2b5f59b12 Merge release-20190806.1-308-gde3dbf8 (automated) 2019-10-23 20:28:54 +00:00
Ghanan Gowripalan de3dbf8a09 Inform netstack integrator when Duplicate Address Detection completes
This change introduces a new interface, stack.NDPDispatcher. It can be
implemented by the netstack integrator to receive NDP related events. As of this
change, only DAD related events are supported.

Tests: Existing tests were modified to use the NDPDispatcher's DAD events for
DAD tests where it needed to wait for DAD completing (failing and resolving).
PiperOrigin-RevId: 276338733
2019-10-23 13:26:35 -07:00
gVisor bot 7735676f1c Merge release-20190806.1-307-gc0065e2 (automated) 2019-10-23 20:02:54 +00:00
Michael Pratt c0065e296f Remove comparison between signed and unsigned int
Some compilers don't like the comparison between int and size_t. Remove it.

The other changes are minor style cleanups.

PiperOrigin-RevId: 276333450
2019-10-23 12:59:48 -07:00
kevin.xu 1f19624fa1
fix typo
fix a typo
2019-10-23 15:21:50 +08:00
kevin.xu 3edbdcc191
remove duplicated period
remove a duplicated period
2019-10-23 14:56:44 +08:00
gVisor bot c555aded4e Merge release-20190806.1-306-g6122b41 (automated) 2019-10-23 00:18:39 +00:00
gVisor bot 6122b413f1 Merge pull request #1046 from tomlanyon:crio
PiperOrigin-RevId: 276172466
2019-10-22 17:05:04 -07:00
gVisor bot efef85c6e7 Merge release-20190806.1-304-gebe8001 (automated) 2019-10-22 23:20:31 +00:00
Ian Lewis ebe8001724 Update const names to be Go style.
PiperOrigin-RevId: 276165962
2019-10-22 16:16:41 -07:00
gVisor bot 97c3c4cc46 Merge release-20190806.1-303-ge63ff6d (automated) 2019-10-22 22:00:21 +00:00
Andrei Vagin e63ff6d923 platform/ptrace: exit without panic if a stub process has been killed by SIGKILL
SIGKILL can be sent only by an user or OOM-killer. In both cases, we don't
need to panic.

PiperOrigin-RevId: 276150120
2019-10-22 14:57:23 -07:00
gVisor bot b66219372b Merge release-20190806.1-302-g515e055 (automated) 2019-10-22 21:46:03 +00:00
Ghanan Gowripalan 515e0558d4 Add a type to represent the NDP Router Advertisement message.
This change is in preparation for NDP Router Discovery where the stack will need
to handle NDP Router Advertisments.

Tests: Test that given an NDP Router Advertisement buffer (body of an ICMPv6
packet, correct values are returned by the field getters).
PiperOrigin-RevId: 276146817
2019-10-22 14:41:51 -07:00
Ghanan Gowripalan c356fe2ebb Respect new PrimaryEndpointBehavior when addresses gets promoted to permanent
This change makes sure that when an address which is already known by a NIC and
has kind = permanentExpired gets promoted to permanent, the new
PrimaryEndpointBehavior is respected.

PiperOrigin-RevId: 276136317
2019-10-22 13:54:33 -07:00
gVisor bot 4bf4cd0e7a Merge release-20190806.1-300-g8720bd6 (automated) 2019-10-22 18:59:52 +00:00
Andrei Vagin 8720bd643e netstack/tcp: software segmentation offload
Right now, we send each tcp packet separately, we call one system
call per-packet. This patch allows to generate multiple tcp packets
and send them by sendmmsg.

The arguable part of this CL is a way how to handle multiple headers.
This CL adds the next field to the Prepandable buffer.

Nginx test results:

Server Software:        nginx/1.15.9
Server Hostname:        10.138.0.2
Server Port:            8080

Document Path:          /10m.txt
Document Length:        10485760 bytes

w/o gso:
Concurrency Level:      5
Time taken for tests:   5.491 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      1048600200 bytes
HTML transferred:       1048576000 bytes
Requests per second:    18.21 [#/sec] (mean)
Time per request:       274.525 [ms] (mean)
Time per request:       54.905 [ms] (mean, across all concurrent requests)
Transfer rate:          186508.03 [Kbytes/sec] received

sw-gso:

Concurrency Level:      5
Time taken for tests:   3.852 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      1048600200 bytes
HTML transferred:       1048576000 bytes
Requests per second:    25.96 [#/sec] (mean)
Time per request:       192.576 [ms] (mean)
Time per request:       38.515 [ms] (mean, across all concurrent requests)
Transfer rate:          265874.92 [Kbytes/sec] received

w/o gso:
$ ./tcp_benchmark --client --duration 15  --ideal
[SUM]  0.0-15.1 sec  2.20 GBytes  1.25 Gbits/sec

software gso:
$ tcp_benchmark --client --duration 15  --ideal --gso $((1<<16)) --swgso
[SUM]  0.0-15.1 sec  3.99 GBytes  2.26 Gbits/sec

PiperOrigin-RevId: 276112677
2019-10-22 11:55:56 -07:00
gVisor bot 1e55a0ef32 Merge release-20190806.1-299-gfb69de6 (automated) 2019-10-22 14:29:06 +00:00
Ghanan Gowripalan fb69de696b Auto-generate an IPv6 link-local address based on the NIC's MAC Address.
This change adds support for optionally auto-generating an IPv6 link-local
address based on the NIC's MAC Address on NIC enable.

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 a link-local
address will not be auto-generated unless the stack is explicitly configured.
See `stack.Options` for more details. Specifically, see
`stack.Options.AutoGenIPv6LinkLocal`.

Tests: Tests to make sure that the IPb6 link-local address is only
auto-generated if the stack is specifically configured to do so. Also tests to
make sure that an auto-generated address goes through the DAD process.
PiperOrigin-RevId: 276059813
2019-10-22 07:26:54 -07:00
Bin Lu 2cee066929 enable ring0 to support arm64
This patch enabled the basic framework for arm64 guest.

Serveral jobs were finished in this patch:
1, ring0.Vectors()
2, switchToUser()
3, basic framwork for Arm64 guest.

Signed-off-by: Bin Lu <bin.lu@arm.com>
2019-10-22 08:33:39 +00:00
gVisor bot 91c723c00b Merge release-20190806.1-298-g070a8c2 (automated) 2019-10-22 00:08:46 +00:00
Nicolas Lacasse 070a8c2d4c Remove old TODO.
PiperOrigin-RevId: 275956240
2019-10-21 17:04:32 -07:00
gVisor bot 8345862af1 Merge release-20190806.1-297-g0b569b7 (automated) 2019-10-21 21:59:17 +00:00