Commit Graph

3703 Commits

Author SHA1 Message Date
Michael Pratt 14839e027f Internal change
PiperOrigin-RevId: 322788791
2020-07-23 08:14:26 -07:00
Ayush Ranjan c9399797d8 Fix kokoro presubmits!
Fixed the following error:
tools/bazel.mk:119: *** Destination not provided..  Stop.
The issue was that we were running all make commands in a subshell so variables
like $T were not passed on.

The other issue was related to credentials. The test passed locally but not on
kokoro, the only difference in the workflow was the credentials bit.

Also fixed up some other tiny issues I came across, were not blockers.

PiperOrigin-RevId: 322782457
2020-07-23 07:29:06 -07:00
Kevin Krakauer bd98f82014 iptables: replace maps with arrays
For iptables users, Check() is a hot path called for every packet one or more
times. Let's avoid a bunch of map lookups.

PiperOrigin-RevId: 322678699
2020-07-22 16:23:55 -07:00
Ayush Ranjan 9654bf04ac [vfs2][tmpfs] Implement O_APPEND
Updates #2923

PiperOrigin-RevId: 322671489
2020-07-22 15:48:43 -07:00
Ayush Ranjan 39525d64cb Add O_APPEND support in vfs2 gofer.
Helps in fixing open syscall tests: AppendConcurrentWrite and AppendOnly.

We also now update the file size for seekable special files (regular files)
which we were not doing earlier.

Updates #2923

PiperOrigin-RevId: 322670843
2020-07-22 15:42:33 -07:00
Bhasker Hariharan 71bf90c55b Support for receiving outbound packets in AF_PACKET.
Updates #173

PiperOrigin-RevId: 322665518
2020-07-22 15:33:33 -07:00
Dean Deng 13c0cca50e Skip RawHDRINCL tests that are blocking presubmits/releases.
Temporarily skip these, on bhaskherh@'s advice.

PiperOrigin-RevId: 322664955
2020-07-22 15:13:03 -07:00
Adin Scannell e1a04f84e8 Add standard entrypoints for test targets.
PiperOrigin-RevId: 322265513
2020-07-20 18:05:05 -07:00
Ian Lewis feb1d3d5a7 Clean up html on the website.
- Fixes some html validation issues.
- Fixes links on security basics blog post.
- Adds rel=noopener to links with target=_blank and adds a check to
  htmlproofer.
- Add favicon check to htmlproofer.

Fixes #3286
Fixes #3284

PiperOrigin-RevId: 321892602
2020-07-17 18:27:41 -07:00
Ting-Yu Wang 5593320bee Update README on cross-building images.
PiperOrigin-RevId: 321887956
2020-07-17 17:44:53 -07:00
Ayush Ranjan 40acd22bc8 Runtime tests are enormous
PiperOrigin-RevId: 321885126
2020-07-17 17:19:34 -07:00
Zach Koopmans e3c2bd51a1 Move main methods for benchmark packages main package file.
PiperOrigin-RevId: 321875119
2020-07-17 16:23:10 -07:00
Ayush Ranjan 03c30ec634 Runtime tests: Download language runtime image
PiperOrigin-RevId: 321839398
2020-07-17 13:07:55 -07:00
Jay Zhuang 40826b0557 DUT logs in test failure messages in packetimpact
DUT logs will include logs from the posix server and gVisor, which
provides a way to instrument the DUT during test failures.

PiperOrigin-RevId: 321816647
2020-07-17 11:18:40 -07:00
Ayush Ranjan c0ee95198a Automated rollback of changelist 321647645
PiperOrigin-RevId: 321808673
2020-07-17 10:45:25 -07:00
Jay Zhuang 7e226c8076 Test UDP packets with mcast source addr are discarded
PiperOrigin-RevId: 321790802
2020-07-17 09:14:17 -07:00
Bhasker Hariharan dcf6ddc277 Add support to return protocol in recvmsg for AF_PACKET.
Updates #173

PiperOrigin-RevId: 321690756
2020-07-16 18:40:32 -07:00
Ayush Ranjan e6894cb99f Port runtime tests to use go_test
PiperOrigin-RevId: 321647645
2020-07-16 14:37:13 -07:00
Ghanan Gowripalan c66991ad7d Add ethernet broadcast address constant
PiperOrigin-RevId: 321620517
2020-07-16 12:26:41 -07:00
gVisor bot 0a745cb343 Merge pull request #3236 from craig08:fuse-kernfs-inode-stat-add-ctx
PiperOrigin-RevId: 321496734
2020-07-15 21:22:44 -07:00
Zach Koopmans 5c8c0d65b9 Port httpd benchmark
PiperOrigin-RevId: 321478001
2020-07-15 18:21:51 -07:00
Kevin Krakauer e92f38ff0c iptables: remove check for NetworkHeader
This is no longer necessary, as we always set NetworkHeader before calling
iptables.Check.

PiperOrigin-RevId: 321461978
2020-07-15 16:35:59 -07:00
gVisor bot bdbab2702a Merge pull request #3022 from prattmic:runsc_do_pdeathsig
PiperOrigin-RevId: 321449877
2020-07-15 15:21:32 -07:00
Ting-Yu Wang db653bb34b fdbased: Vectorized write for packet; relax writev syscall filter.
Now it calls pkt.Data.ToView() when writing the packet. This may require
copying when the packet is large, which puts the worse case in an even worse
situation.

This sent out in a separate preparation change as it requires syscall filter
changes. This change will be followed by the change for the adoption of the new
PacketHeader API.

PiperOrigin-RevId: 321447003
2020-07-15 15:05:32 -07:00
Bhasker Hariharan 857d03f258 Add support for SO_ERROR to packet sockets.
Packet sockets also seem to allow double binding and do not return an error on
linux. This was tested by running the syscall test in a linux namespace as root
and the current test DoubleBind fails@HEAD.

Passes after this change.

Updates #173

PiperOrigin-RevId: 321445137
2020-07-15 14:56:39 -07:00
Bhasker Hariharan fef90c61c6 Fix minor bugs in a couple of interface IOCTLs.
gVisor incorrectly returns the wrong ARP type for SIOGIFHWADDR. This breaks
tcpdump as it tries to interpret the packets incorrectly.

Similarly, SIOCETHTOOL is used by tcpdump to query interface properties which
fails with an EINVAL since we don't implement it. For now change it to return
EOPNOTSUPP to indicate that we don't support the query rather than return
EINVAL.

NOTE: ARPHRD types for link endpoints are distinct from NIC capabilities
and NIC flags. In Linux all 3 exist eg. ARPHRD types are stored in dev->type
field while NIC capabilities are more like the device features which can be
queried using SIOCETHTOOL but not modified and NIC Flags are fields that can
be modified from user space. eg. NIC status (UP/DOWN/MULTICAST/BROADCAST) etc.

Updates #2746

PiperOrigin-RevId: 321436525
2020-07-15 14:15:44 -07:00
Ting-Yu Wang 1d11c40378 Fix errors not getting caught when building vm image.
`set -e` does not catch errors in bash command substituions like
`echo $(bad cmd)` so bazel thinks it succeeded and cached the result.

PiperOrigin-RevId: 321412327
2020-07-15 12:20:23 -07:00
Michael Pratt 1481673178 Apply pdeathsig to gofer for runsc run/do
Much like the boot process, apply pdeathsig to the gofer for cases where
the sandbox lifecycle is attached to the parent (runsc run/do).

This isn't strictly necessary, as the gofer normally exits once the
sentry disappears, but this makes that extra reliable.
2020-07-15 15:15:11 -04:00
gVisor bot 8939fae0af Merge pull request #3165 from ridwanmsharif:ridwanmsharif/fuse-off-by-default
PiperOrigin-RevId: 321411758
2020-07-15 12:14:42 -07:00
gVisor bot fc48ace73a Merge pull request #3242 from btw616:fix/issue-3241
PiperOrigin-RevId: 321403149
2020-07-15 11:34:07 -07:00
Tiwei Bie 505bebae43 hostinet: fix fd leak in fdnotifier for VFS2
When we failed to create the new socket after adding the fd to
fdnotifier, we should remove the fd from fdnotifier, because we
are going to close the fd directly.

Fixes: #3241

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
2020-07-15 22:20:02 +08:00
Dean Deng 1b9965e06a Update special file option name in comment.
PiperOrigin-RevId: 321269281
2020-07-14 17:31:48 -07:00
Craig Chi 8494a0325d Include context in kernfs.Inode.Stat method
To implement stat(2) in FUSE, we have to embed credentials and pid in request
header. The information should be extracted from the context passed to VFS
layer. Therefore `Stat()` signature in `kernfs.Inode` interface should include
context as first argument. Some other fs implementations need to be modified as
well, such as devpts, host, pipefs, and proc.

Fixes #3235
2020-07-14 15:56:41 -07:00
Kevin Krakauer 8a0082f5f3 remove IPv6 docker
Will re-submit when ICMP dest unreachable is handled correctly and it can be
turned back on.

PiperOrigin-RevId: 321227330
2020-07-14 13:49:15 -07:00
Zeling Feng 221e1da947 Test IPv6 fragment reassembly
A packetimpact test for: "A node must be able to accept a fragmented packet
that, after reassembly, is as large as 1500 octets."

PiperOrigin-RevId: 321210729
2020-07-14 12:29:34 -07:00
Fabricio Voznika 1bfb556ccd Prepare boot.Loader to support multi-container TTY
- Combine process creation code that is shared between
  root and subcontainer processes
- Move root container information into a struct for
  clarity

Updates #2714

PiperOrigin-RevId: 321204798
2020-07-14 12:02:03 -07:00
Jay Zhuang 822fc99ecd Add support for UDP IPv6
Also ironed out all the bugs found on the IPv6 code path that affects socket
bind, send and receive.

PiperOrigin-RevId: 321202653
2020-07-14 11:49:51 -07:00
Ting-Yu Wang 87c33be9af Enable experimental features in docker.
PiperOrigin-RevId: 321062975
2020-07-13 17:02:32 -07:00
gVisor bot c5d827d110 Merge pull request #3200 from lubinszARM:pr_kvm_ut_1
PiperOrigin-RevId: 321060717
2020-07-13 16:49:20 -07:00
gVisor bot c81ac8ec3b Merge pull request #2672 from amscanne:shim-integrated
PiperOrigin-RevId: 321053634
2020-07-13 16:10:58 -07:00
Fabricio Voznika 59a5479409 Disable debug time adjustment logging
When --debug is enabled, the following log messages are
printed every second filling up the log:

D0430 18:04:42.823775  129561 parameters.go:238] Clock(Monotonic): error: 46 ns, adjusted frequency from 3591713733 Hz to 3591714196 Hz
D0430 18:04:42.823870  129561 parameters.go:238] Clock(Realtime): error: 36 ns, adjusted frequency from 3591714003 Hz to 3591714169 Hz
D0430 18:04:42.823892  129561 timekeeper.go:209] Updating VDSO parameters: {monotonicReady:1 monotonicBaseCycles:15758797714254696 monotonicBaseRef:29000233837 monotonicFrequency:3591714196 realtimeReady:1 realtimeBaseCycles:15758797714610880 realtimeBaseRef:1588269882823867374 realtimeFrequency:3591714169}

Info and warning messages for larger changes are kept the same.

PiperOrigin-RevId: 321048523
2020-07-13 15:42:53 -07:00
Ian Lewis 74df310ac0 Don't run issue reviver on forks.
Add a conditional to avoid running the issue reviver on forks. It will
always cause errors since bug references in the source code don't match
issue IDs in forked repos.

PiperOrigin-RevId: 321042060
2020-07-13 15:07:00 -07:00
Ting-Yu Wang a287309d9f Fix recvMMsgDispatcher not slicing link header correctly.
PiperOrigin-RevId: 321035635
2020-07-13 14:36:38 -07:00
Ayush Ranjan 28c635e5d4 Fix runtime test target
PiperOrigin-RevId: 321029113
2020-07-13 14:07:41 -07:00
Dean Deng cf0826653c Clean up inotify comments.
PiperOrigin-RevId: 321028238
2020-07-13 14:02:07 -07:00
Kevin Krakauer 3fe9be138c iptables: remove useless ip6tables VM rules
This rule isn't restored when the Kokoro VM is restarted, so it's not doing
anything. And the problem it was meant to solved is instead addressed by
https://github.com/google/gvisor/pull/3207.

PiperOrigin-RevId: 321026846
2020-07-13 13:54:54 -07:00
Ayush Ranjan 6994f4d591 [vfs2] Make gofer metadata atomics consistent
For accessing metadata fields:
- If metadataMu is locked, we can access without atomics
- If metadataMu is unlocked, we should use atomics

For mutating metadata fields:
- Always lock metadataMu and use atomics.

There were some instances of inconsistencies which have been fixed.

PiperOrigin-RevId: 321022895
2020-07-13 13:35:32 -07:00
Zach Koopmans b8d3d09bd1 Initial golang Benchmarks
PiperOrigin-RevId: 321021071
2020-07-13 13:29:30 -07:00
gVisor bot 505b4f5e5f Merge pull request #3136 from lubinszARM:pr_sys64_1
PiperOrigin-RevId: 321020733
2020-07-13 13:24:01 -07:00
Fabricio Voznika b7e8ce93de Add ReadAllFd to test util
PiperOrigin-RevId: 321008185
2020-07-13 12:23:18 -07:00