Commit Graph

1262 Commits

Author SHA1 Message Date
Andrei Vagin b9b99d3d26 Don't check that msg_flags contains MSG_ERRQUEUE on gvisor platforms.
PiperOrigin-RevId: 350246333
2021-01-05 16:47:39 -08:00
Adin Scannell b06e5bc5b0 Add benchmarks targets to BuildKite.
This includes minor fix-ups:

* Handle SIGTERM in runsc debug, to exit gracefully.
* Fix cmd.debug.go opening all profiles as RDONLY.
* Fix the test name in fio_test.go, and encode the block size in the test.

PiperOrigin-RevId: 350205718
2021-01-05 13:21:54 -08:00
Andrei Vagin 2a200811d4 fs/fuse: check that a task has a specified file descriptor
Reported-by: syzbot+814105309d2ae8651084@syzkaller.appspotmail.com
PiperOrigin-RevId: 350159452
2021-01-05 09:47:30 -08:00
Dean Deng 4691a81253 Add test for open(2) with O_WRONLY|O_RDWR.
PiperOrigin-RevId: 349607959
2020-12-30 15:22:35 -08:00
Ting-Yu Wang fc153750ed Deflake TestBindOverlay in //test/e2e:integration_test
Test failure happens when `echo` writes late:
* Server nc shuts down write when it sees EOF from stdin.
* Client nc closes the connection when it detects EOF from socket and no data
  in internal write buffer.

Using `-q` flag to make server not shutting down write in the beginning, while
letting connection to be closed by client. As `-q` flag's default value varies
in different netcat versions, we always specify it to prevent future breakage.

PiperOrigin-RevId: 349504016
2020-12-29 20:24:40 -08:00
Adin Scannell ffa9a715aa Simplify profiling and benchmarks.
- Tweak the benchmarks to work with b.N where appropriate. In many cases,
  b.N was simply being ignored. This creates an implicit dependency in the
  user passing a reasonable benchtime (less than or equal to the actual
  runtime of the test, or using the X syntax) otherwise the test runs
  forever.
- In cases where the above is impossible, explicitly set benchtime from
  the test wrapper, to prevent the above behavior (tensorflow).
- Drop the *Reverse variants, which are simply hey benchmarks. We should
  just add a hey benchmark. The platforms benchmarks already include a
  native platform, and thus these benchmarks are incredibly confusing.
  (In other words, BenchmarkNginxReverse has nothing to do with an nginx
  benchmark for runsc.)
- Remove the redunant Harness object, which contains no state, in order
  to slightly simplify the code.
- Make Block and Heap profiling actually work, but setting appropriate
  runtime parameters (and plumbing them through the config).
- Split the profiling into two phases: start and stop, since some will
  need to be started early, and others will need to happen at the end.

PiperOrigin-RevId: 349495377
2020-12-29 18:29:12 -08:00
Jing Chen d302c05700 Deflake semaphore_test_native
PiperOrigin-RevId: 349490873
2020-12-29 17:38:23 -08:00
Tamir Duberstein 91c05c609e Export socket_ipv6_udp_unbound_loopback.cc
PiperOrigin-RevId: 349458984
2020-12-29 12:56:59 -08:00
gVisor bot 5dc60a7632 Merge pull request #5166 from kevinGC:bk-warnings
PiperOrigin-RevId: 349314945
2020-12-28 12:12:35 -08:00
Kevin Krakauer 5259b90dac Resolve compiler warnings
The buildkite syscall tests start with a lot of C++ warnings. This
cleans that up a little.
2020-12-23 16:49:01 -08:00
Andrei Vagin d079159876 vfs1: don't allow to open socket files
open() has to return ENXIO in this case.

O_PATH isn't supported by vfs1.

PiperOrigin-RevId: 348820478
2020-12-23 11:11:07 -08:00
gVisor bot 6d96a2394d Internal change.
PiperOrigin-RevId: 348720223
2020-12-22 17:46:41 -08:00
gVisor bot a0209de301 Internal change.
PiperOrigin-RevId: 348089449
2020-12-17 14:05:01 -08:00
Nicolas Lacasse 1ea241e4cc Fix seek on /proc/pid/cmdline when task is zombie.
PiperOrigin-RevId: 348056159
2020-12-17 11:16:06 -08:00
Ayush Ranjan 028271b530 [netstack] Implement IP(V6)_RECVERR socket option.
PiperOrigin-RevId: 348055514
2020-12-17 11:10:41 -08:00
Fabricio Voznika e7493a9e23 Set max memory not min
Closes #5048

PiperOrigin-RevId: 348050472
2020-12-17 10:46:47 -08:00
Mithun Iyer b645fcd241 Ensure correctness of saved receive window
When the scaled receive window size > 65535 (max uint16), we advertise
the scaled value as 65535, but are not adjusting the saved receive
window value when doing so. This would keep our current window
calculation logic to be incorrect, as the saved receive window value
is different from what was advertised.

Fixes #4903

PiperOrigin-RevId: 347771340
2020-12-16 00:24:28 -08:00
Jing Chen 1e56a2f9a2 Implement command SEM_INFO and SEM_STAT for semctl.
PiperOrigin-RevId: 347711998
2020-12-15 16:06:06 -08:00
Nayana Bidari b15acae9a6 Fix error code for connect in raw sockets.
PiperOrigin-RevId: 347650354
2020-12-15 11:07:48 -08:00
Ayush Ranjan a1c56bc227 [netstack] Update raw socket and hostinet control message parsing.
There are surprisingly few syscall tests that run with hostinet. For example
running the following command only returns two results:
`bazel query test/syscalls:all | grep hostnet`

I think as a result, as our control messages evolved, hostinet was left
behind. Update it to support all control messages netstack supports.

This change also updates sentry's control message parsing logic to make it up to
date with all the control messages we support.

PiperOrigin-RevId: 347508892
2020-12-14 18:00:55 -08:00
Nayana Bidari ab593661ef Move SO_ERROR and SO_OOBINLINE option to socketops.
SO_OOBINLINE option is set/get as boolean value, which is the same as linux.
As we currently do not support disabling this option, we always return it as
true.

PiperOrigin-RevId: 347413905
2020-12-14 10:22:32 -08:00
Bruno Dal Bo 4aef908c92 Introduce IPv6 extension header serialization facilities
Adds IPv6 extension header serializer and Hop by Hop options serializer.
Add RouterAlert option serializer and use it in MLD.

Fixed #4996

Startblock:
  has LGTM from marinaciocea
  and then
  add reviewer ghanan
PiperOrigin-RevId: 347174537
2020-12-12 09:07:44 -08:00
Zach Koopmans 4b697aae55 Fix long running bazel build jobs.
- Skip the bazel clean command on the last run of the benchmark.
- Use --test.benchtime=1ns to force running the benchmark once
(https://github.com/golang/go/issues/32051)

PiperOrigin-RevId: 347124606
2020-12-11 20:56:09 -08:00
Nayana Bidari d45420b152 Fix panic when IPv4 address is used in sendmsg for IPv6 sockets
We do not rely on error for getsockopt options(which have boolean values)
anymore. This will cause issue in sendmsg where we used to return error
for IPV6_V6Only option. Fix the panic by returning error (for sockets other
than TCP and UDP) if the address does not match the type(AF_INET/AF_INET6) of
the socket.

PiperOrigin-RevId: 347063838
2020-12-11 13:31:28 -08:00
Zach Koopmans 305a456551 Adjust requests to be constant equal to b.N in network tests.
For "hey", requests >= concurrency. b.N can be set by the
--test.benchtime={b.N}x. The previous setting of b.N * c
can be surprisingly slow for larger c.

Set the requests to max(b.N, c) and log to the user if it is c.

PiperOrigin-RevId: 347053675
2020-12-11 12:37:28 -08:00
Adin Scannell 4cba3904f4 Remove existing nogo exceptions.
PiperOrigin-RevId: 347047550
2020-12-11 12:06:49 -08:00
Jing Chen 73eccab91e Make semctl IPC_INFO cmd return the index of highest used entry.
PiperOrigin-RevId: 346973338
2020-12-11 04:22:04 -08:00
Tamir Duberstein 01126d47fc Log window size
Without this change, this test produces quite opaque errors as valid TCP
segments are not logged; what we see in the end is any random traffic that
happened *after* the final TCP segment.

PiperOrigin-RevId: 346864169
2020-12-10 14:23:10 -08:00
Tamir Duberstein 7fa0a57fc9 Uncomment payload generation
PiperOrigin-RevId: 346852543
2020-12-10 13:27:43 -08:00
Tamir Duberstein 205015687b Correctly align non-matching layers
PiperOrigin-RevId: 346840424
2020-12-10 12:27:46 -08:00
Tamir Duberstein a177bfdbc4 Correctly print non-matching layers
PiperOrigin-RevId: 346818310
2020-12-10 10:52:13 -08:00
Bhasker Hariharan 92ca72ecb7 Add support for IP_RECVORIGDSTADDR IP option.
Fixes #5004

PiperOrigin-RevId: 346643745
2020-12-09 15:58:53 -08:00
Zach Koopmans b4af9d4572 Add network benchmarks jobs
Add httpd, nginx, node, and ruby benchmarks to continuous jobs.

PiperOrigin-RevId: 346629115
2020-12-09 15:57:58 -08:00
Zach Koopmans 992769c774 Add tensorflow, ffmpeg, and redis jobs.
PiperOrigin-RevId: 346603153
2020-12-09 15:56:08 -08:00
Adin Scannell a855a814d6 Refactor the Makefile to avoid recursive Make.
Recursive make is difficult to follow and debug. Drop this by using
internal functions, which, while difficult, are easier than trying to
following recursive invokations.

Further simplify the Makefile by collapsing the image bits and removing
the tools/vm directory, which is effectively unused.

Fixes #4952

PiperOrigin-RevId: 346569133
2020-12-09 15:53:23 -08:00
Zeling Feng 96d14de0fa export MountTempDirectory
PiperOrigin-RevId: 346487763
2020-12-09 15:50:35 -08:00
Tamir Duberstein cc522a9cfb Run tcpdump as root
Prior to this change tcpdump would fail to create its output file
because the destination directory was owned by root. This would later
cause killall to fail, as tcpdump was not running. Check exit code of
tcpdump/tshark to produce better error messages should this regress.

PiperOrigin-RevId: 346353911
2020-12-08 10:20:38 -08:00
Tamir Duberstein 5ea6419478 Consolidate sniffer program logic
Avoid action at a distance where both `snifferArgs` and `snifferProg`
must stay in sync.

PiperOrigin-RevId: 346341231
2020-12-08 09:24:02 -08:00
Rahat Mahmood 9c198e5df4 Fix error handling on fusefs mount.
Don't propagate arbitrary golang errors up from fusefs because errors
that don't map to an errno result in a sentry panic.

Reported-by: syzbot+697cb635346e456fddfc@syzkaller.appspotmail.com
PiperOrigin-RevId: 346220306
2020-12-07 18:00:54 -08:00
Tamir Duberstein 1aeca3bfb7 Remove detritus
- Remove unused constants
- Correct function doc comment
- Remove useless cast
- Restore comment removed in an earlier change

PiperOrigin-RevId: 346205943
2020-12-07 16:34:39 -08:00
Zach Koopmans 6d30688bd7 Fix tags on benchmark targets.
PiperOrigin-RevId: 346203209
2020-12-07 16:20:12 -08:00
Tamir Duberstein 432964d035 Avoid shadowing `testbench` package
PiperOrigin-RevId: 346109185
2020-12-07 09:28:38 -08:00
Peter Johnston eeb23531eb Support icmpv6 transport protocol
PiperOrigin-RevId: 346101076
2020-12-07 08:44:44 -08:00
gVisor bot a97ceec01b Merge pull request #4932 from lubinszARM:pr_test_exceptions
PiperOrigin-RevId: 345976554
2020-12-06 13:06:37 -08:00
Mithun Iyer 3075ede86e Fix zero receive window advertisements.
With the recent changes db36d948fa, we try
to balance the receive window advertisements between payload lengths vs
segment overhead length. This works fine when segment size are much
higher than the overhead, but not otherwise. In cases where the segment
length is smaller than the segment overhead, we may end up not
advertising zero receive window for long time and end up tail-dropping
segments. This is especially pronounced when application socket reads
are slow or stopped. In this change we do not grow the right edge of
the receive window for smaller segment sizes similar to Linux.
Also, we keep track of the socket buffer usage and let the window grow
if the application is actively reading data.

Fixes #4903

PiperOrigin-RevId: 345832012
2020-12-05 01:48:00 -08:00
Adin Scannell 7a1de8583d Remove invalid test case.
The next test case is perfectly valid, which creates a test directory
with appropriate permissions and ensures that you can't create a file.

This test case assumes that the root directory has certain permissions.
In this case, we may have EROFS instead of a permission error, but it's
perfectly plausible that no error occurs at all. The test is not valid.

PiperOrigin-RevId: 345764412
2020-12-04 15:11:55 -08:00
Adin Scannell 1371b73b4b Initialize has_tid for correctness.
PiperOrigin-RevId: 345763209
2020-12-04 14:59:54 -08:00
Bruno Dal Bo fd28ccfaa4 Introduce IPv4 options serializer and add RouterAlert to IGMP
PiperOrigin-RevId: 345701623
2020-12-04 10:10:56 -08:00
Jing Chen a78cef0ed7 Implement command IPC_INFO for semctl.
PiperOrigin-RevId: 345589628
2020-12-03 19:57:51 -08:00
Etienne Perot 6f60a2b0a2 Implement `fcntl` options `F_GETSIG` and `F_SETSIG`.
These options allow overriding the signal that gets sent to the process when
I/O operations are available on the file descriptor, rather than the default
`SIGIO` signal. Doing so also populates `siginfo` to contain extra information
about which file descriptor caused the event (`si_fd`) and what events happened
on it (`si_band`). The logic around which FD is populated within `si_fd`
matches Linux's, which means it has some weird edge cases where that value may
not actually refer to a file descriptor that is still valid.

This CL also ports extra S/R logic regarding async handler in VFS2.
Without this, async I/O handlers aren't properly re-registered after S/R.

PiperOrigin-RevId: 345436598
2020-12-03 06:20:29 -08:00