Commit Graph

5180 Commits

Author SHA1 Message Date
gVisor bot fed1cc6d8c Internal change.
PiperOrigin-RevId: 358890980
2021-02-22 13:31:13 -08:00
Andrei Vagin c5a4e10008 unix: sendmmsg and recvmsg have to cap a number of message to UIO_MAXIOV
Reported-by: syzbot+f2489ba0b999a45d1ad1@syzkaller.appspotmail.com
PiperOrigin-RevId: 358866218
2021-02-22 11:51:30 -08:00
Fabricio Voznika 19fe3a2bfb Fix `runsc kill --pid`
Previously, loader.signalProcess was inconsitently using both root and
container's PID namespace to find the process. It used root namespace
for the exec'd process and container's PID namespace for other processes.
This fixes the code to use the root PID namespace across the board, which
is the same PID reported in `runsc ps` (or soon will after
https://github.com/google/gvisor/pull/5519).

PiperOrigin-RevId: 358836297
2021-02-22 09:33:46 -08:00
Nicolas Lacasse 93fc09248a Don't hold baseEndpoint.mu while calling EventUpdate().
This removes a three-lock deadlock between fdnotifier.notifier.mu,
epoll.EventPoll.listsMu, and baseEndpoint.mu.

A lock order comment was added to epoll/epoll.go.

Also fix unsafe access of baseEndpoint.connected/receiver.

PiperOrigin-RevId: 358515191
2021-02-19 17:38:51 -08:00
Zach Koopmans 7544eeb242 Correctly set and respect b.N in fio benchmark.
fio should scale by written/read bytes and not iterate runs
of the fio container.

PiperOrigin-RevId: 358511771
2021-02-19 17:12:42 -08:00
Nicolas Lacasse 5e22ab93e6 control.Proc.Exec should default to root pid namespace if none provided.
PiperOrigin-RevId: 358445320
2021-02-19 11:25:35 -08:00
Rahat Mahmood 599579d0e5 Add a few more project ideas to the gsoc 2021 list
PiperOrigin-RevId: 358354414
2021-02-19 00:52:51 -08:00
Bhasker Hariharan ec7f44f36b Make socketops reflect correct sndbuf value for host UDS.
Also skips a test if the setsockopt to increase send buffer did not result in an
increase. This is possible when the underlying socket is a host backed unix
domain socket as in such cases gVisor does not permit increasing SO_SNDBUF.

PiperOrigin-RevId: 358285158
2021-02-18 16:00:38 -08:00
Michael Pratt f80a857a4f Bump build constraints to Go 1.18
These are bumped to allow early testing of Go 1.17. Use will be audited closer
to the 1.17 release.

PiperOrigin-RevId: 358278615
2021-02-18 15:30:58 -08:00
Zach Koopmans ec20f4f38e Make b.N increase by KB not bytes on iperf.
Currently, iperf runs a client that scales by
bytes sent. In practice, this causes b.N to scale
slowly and have several short lived containers.

Instead, scale by KB to more quickly reach required time.

PiperOrigin-RevId: 358244926
2021-02-18 13:01:44 -08:00
Arthur Sfez 2a2cb29e1c Validate IGMP packets
This change also adds support for Router Alert option processing on
incoming packets, a new stat for Router Alert option, and exports
all the IP-option related stats.

Fixes #5491

PiperOrigin-RevId: 358238123
2021-02-18 12:29:54 -08:00
Tamir Duberstein 26eada5dea Use standard want/got syntax in test errors
Remove unused argument while I'm here and avoid returning
syscall.Errno(0) which should rather be a nil error.

PiperOrigin-RevId: 358227396
2021-02-18 11:46:00 -08:00
Sam Balana bb5db80448 Remove deprecated NUD types Failed and FailedEntryLookups
Completes the soft migration to Unreachable state by removing the Failed state
and the the FailedEntryLookups StatCounter.

Fixes #4667

PiperOrigin-RevId: 358226380
2021-02-18 11:40:52 -08:00
Fabricio Voznika 582f7bf6c0 Remove side effect from pty tests
Individual test cases must not rely on being executed in a clean environment.

PiperOrigin-RevId: 358207468
2021-02-18 10:19:04 -08:00
Zeling Feng f4d694693c Deflake tcp_network_unreachable test
Previously, we make two connect attempts. If the first attempt is still on
going when the second attempt is made, the test will fail. This change deflakes
the situation by not making the second attempt, instead, we poll for the first
attempt's completion and read the errno from SO_ERROR.

PiperOrigin-RevId: 358104769
2021-02-17 22:07:06 -08:00
Ayush Ranjan dea894238b [infra] Update JDK11 version for java runtime tests.
PiperOrigin-RevId: 358085809
2021-02-17 19:28:43 -08:00
Kevin Krakauer 1fc2c5f750 Move Name() out of netstack Matcher. It can live in the sentry.
PiperOrigin-RevId: 358078157
2021-02-17 18:24:34 -08:00
Jamie Liu f051ec6463 Add gohacks.Slice/StringHeader.
See https://github.com/golang/go/issues/19367 for rationale. Note that the
upstream decision arrived at in that thread, while useful for some of our use
cases, doesn't account for all of our SliceHeader use cases (we often use
SliceHeader to extract pointers from slices in a way that avoids bounds
checking and/or handles nil slices correctly) and also doesn't exist yet.

PiperOrigin-RevId: 358071574
2021-02-17 17:41:10 -08:00
Jamie Liu 4bc7daf91a Check for directory emptiness in VFS1 overlay rmdir().
Note that this CL reorders overlayEntry.copyMu before overlayEntry.dirCacheMu
in the overlayFileOperations.IterateDir() => readdirEntries() path - but this
lock ordering is already required by overlayRemove/Bind() =>
overlayEntry.markDirectoryDirty(), so this actually just fixes an
inconsistency.

PiperOrigin-RevId: 358047121
2021-02-17 15:33:47 -08:00
Nayana Bidari 3145fe1d1e Use TCP_INFO to get RTO in tcp_retransmits_test
- TCP_INFO is used to get the RTO instead of calculating it manually.

PiperOrigin-RevId: 358032487
2021-02-17 14:25:29 -08:00
Tamir Duberstein 0e0bc35879 Clean up test style
- Wrap comments at 80 columns
- Avoid duplicating the number of retries (5)
- Reduce indentation
- Use (*testing.T).Fatal rather than (*testing.T).Fatalf

PiperOrigin-RevId: 358017412
2021-02-17 13:17:06 -08:00
Ayush Ranjan d8590f6337 [infra] Split tcpip/integration test targets to aid investigation.
tcpip integration tests have been flaky lately. They usually run in 20 seconds
and have a 60 seconds timeout. Sometimes they timeout which could be due to
a bug or deadlock. To further investigate it might be helpful to split the
targets and see which test is causing the flake.

Added a new tcpip/tests/utils package to hold all common utilities across all
tests.

PiperOrigin-RevId: 358012936
2021-02-17 12:54:55 -08:00
Kevin Krakauer 2f35fa14ab Deflake //test/iptables:iptables_test
We were opening dual-stack sockets, but tests only set iptables rules for a
single network protocol. Thus, packets (probably sent by previous tests) could
sneak in and break tests.

Tested with:
bazel test ///test/iptables:iptables_test
--test_arg=--runtime=runsc --nocache_test_results --test_output=errors
--runs_per_test=1000 --test_filter=TestFilterInputDropUDP
PiperOrigin-RevId: 357972385
2021-02-17 10:02:02 -08:00
Adin Scannell 3ef012944d Stop the control server only once.
Operations are now shut down automatically by the main Stop
command, and it is not necessary to call Stop during Destroy.

Fixes #5454

PiperOrigin-RevId: 357295930
2021-02-12 17:13:44 -08:00
Nayana Bidari 33c617cae3 Remove packetimpact test tcp_reordering
Remove flaky tcp_reordering_test as it does not check reordering. We have
added new reorder tests in tcp_rack_test.go

PiperOrigin-RevId: 357278769
2021-02-12 15:27:29 -08:00
Zach Koopmans 58a0a66900 Rename params for iperf and tensorflow.
Rename operation params in iperf and tensorflow to
match other similar benchmarks.

PiperOrigin-RevId: 357250304
2021-02-12 12:55:33 -08:00
Rahat Mahmood c99ad8d541 Add reference to gsoc 2021 proposal page for website.
PiperOrigin-RevId: 357241880
2021-02-12 12:12:53 -08:00
Zach Koopmans ba51999fa6 Fix bug with iperf and don't profile runc.
Fix issue with iperf where b.N wasn't changing across runs.
Also, if the given runtime is runc/not given, don't run a profile against it.

PiperOrigin-RevId: 357231450
2021-02-12 11:28:16 -08:00
Andrei Vagin a6d813ad55 tests: getsockname expects that addrlen will be initialized
PiperOrigin-RevId: 357224877
2021-02-12 10:58:17 -08:00
Ayush Ranjan 845d0a65f4 [rack] TLP: ACK Processing and PTO scheduling.
This change implements TLP details enumerated in
https://tools.ietf.org/html/draft-ietf-tcpm-rack-08#section-7.5.3

Fixes #5085

PiperOrigin-RevId: 357125037
2021-02-11 22:06:09 -08:00
Jamie Liu 34614c3986 Unconditionally check for directory-ness in overlay.filesystem.UnlinkAt().
PiperOrigin-RevId: 357106080
2021-02-11 19:10:22 -08:00
Ayush Ranjan 91cf7b3ca4 [netstack] Fix recovery entry and exit checks.
Entry check:

- Earlier implementation was preventing us from entering recovery even if
  SND.UNA is lost but dupAckCount is still below threshold. Fixed that.
- We should only enter recovery when at least one more byte of data beyond the
  highest byte that was outstanding when fast retransmit was last entered is
  acked. Added that check.

Exit check:

- Earlier we were checking if SEG.ACK is in range [SND.UNA, SND.NXT]. The
  intention was to check if any unacknowledged data was ACKed. Note that
  (SEG.ACK - 1) is actually the sequence number which was ACKed. So we were
  incorrectly including (SND.UNA - 1) in the range. Fixed the check to now be
  (SEG.ACK - 1) in range [SND.UNA, SND.NXT).

Additionally, moved a RACK specific test to the rack tests file.
Added tests for the changes I made.

PiperOrigin-RevId: 357091322
2021-02-11 17:19:47 -08:00
gVisor bot 4314bb0b2b Internal change.
PiperOrigin-RevId: 357090170
2021-02-11 17:12:23 -08:00
Kevin Krakauer c39284f457 Let sentry understand tcpip.ErrMalformedHeader
Added a LINT IfChange/ThenChange check to catch this in the future.

PiperOrigin-RevId: 357077564
2021-02-11 16:01:43 -08:00
Toshi Kikuchi 2129dfff61 iptables test: Implement testCase interface on pointers
Implementing interfaces on value types causes the interface to be
implemented by both the value type and the pointer type of the
implementer. This complicates type assertion as it requires the
assertion to check for both the pointer type and the value type.

PiperOrigin-RevId: 357061063
2021-02-11 14:39:41 -08:00
Jing Chen c833eed80a Implement semtimedop.
PiperOrigin-RevId: 357031904
2021-02-11 12:21:59 -08:00
Kevin Krakauer ae8d966f5a Assign controlling terminal when tty is opened and support NOCTTY
PiperOrigin-RevId: 357015186
2021-02-11 11:09:22 -08:00
Fabricio Voznika 192780946f Allow rt_sigaction in gofer seccomp
rt_sigaction may be called by Go runtime when trying to panic:

https://cs.opensource.google/go/go/+/master:src/runtime/signal_unix.go;drc=ed3e4afa12d655a0c5606bcf3dd4e1cdadcb1476;bpv=1;bpt=1;l=780?q=rt_sigaction&ss=go

Updates #5038

PiperOrigin-RevId: 357013186
2021-02-11 11:01:21 -08:00
Kevin Krakauer 81ea0016e6 Support setgid directories in tmpfs and kernfs
PiperOrigin-RevId: 356868412
2021-02-10 17:45:18 -08:00
Nayana Bidari ff04d019e3 RACK: Fix re-transmitting the segment twice when entering recovery.
TestRACKWithDuplicateACK is flaky as the reorder window can expire before
receiving three duplicate ACKs which will result in sending the first
unacknowledged segment twice: when reorder timer expired and again after
receiving the third duplicate ACK.

This CL will fix this behavior and will not resend the segment again if it was
already re-transmittted when reorder timer expired.

Update the TestRACKWithDuplicateACK to test that the first segment is
considered as lost and is re-transmitted.

PiperOrigin-RevId: 356855168
2021-02-10 16:38:55 -08:00
Andrei Vagin 97a36d1696 Don't allow to umount the namespace root mount
Linux does the same thing.

Reported-by: syzbot+6c79385c930c929d1d9e@syzkaller.appspotmail.com
PiperOrigin-RevId: 356854562
2021-02-10 16:32:45 -08:00
Ayush Ranjan 96d3b3188b Fix broken IFTTT link in tcpip.
PiperOrigin-RevId: 356852625
2021-02-10 16:22:53 -08:00
Zach Koopmans 36e4100a28 Update benchmarks README.md
PiperOrigin-RevId: 356843249
2021-02-10 15:42:48 -08:00
Mithun Iyer 380ede9b73 Retry RST expectation in tcp_synrcvd_reset_test
Deflake this test by retransmitting the ACK and retrying RST
expectation after the supposed state transition to CLOSED.
This gives time for the state transition to complete.

Without such a retransmit from the test, the ACK could get silently
dropped by the listener when the passively connecting endpoint
has not yet completely updated the state (in gVisor this would be
endpoint state and decrement of synRcvdCount).

PiperOrigin-RevId: 356825562
2021-02-10 14:22:16 -08:00
Rahat Mahmood c2f204658e Add proposal for io_uring project.
PiperOrigin-RevId: 356807933
2021-02-10 13:06:42 -08:00
Matt LaPlante 458bf12c13 Internal change.
PiperOrigin-RevId: 356784956
2021-02-10 11:36:15 -08:00
Zach Koopmans 1ac58cc23e Add mitigate command to runsc
PiperOrigin-RevId: 356772367
2021-02-10 10:48:48 -08:00
gVisor bot b9db7db3bd Merge pull request #5267 from lubinszARM:pr_usr_lazy_fp
PiperOrigin-RevId: 356762859
2021-02-10 10:10:17 -08:00
Bhasker Hariharan 298c129cc1 Add support for setting SO_SNDBUF for unix domain sockets.
The limits for snd/rcv buffers for unix domain socket is controlled by the
following sysctls on linux

 - net.core.rmem_default
 - net.core.rmem_max
 - net.core.wmem_default
 - net.core.wmem_max

Today in gVisor we do not expose these sysctls but we do support setting the
equivalent in netstack via stack.Options() method. But AF_UNIX sockets in gVisor
can be used without netstack, with hostinet or even without any networking stack
at all. Which means ideally these sysctls need to live as globals in gVisor.

But rather than make this a big change for now we hardcode the limits in the
AF_UNIX implementation itself (which in itself is better than where we were
before) where it SO_SNDBUF was hardcoded to 16KiB. Further we bump the initial
limit to a default value of 208 KiB to match linux from the paltry 16 KiB we use
today.

Updates #5132

PiperOrigin-RevId: 356665498
2021-02-09 21:55:16 -08:00
Zeling Feng 2de36e44ed Make RPCTimeout for udp_send_recv_dgram to be 500 milliseconds.
The test will sometimes fail on Bind calls using the old RPCTimeout.

PiperOrigin-RevId: 356646668
2021-02-09 19:32:47 -08:00