Commit Graph

5095 Commits

Author SHA1 Message Date
Nayana Bidari eaba5bc7ef Fix flaky packetimpact test
PiperOrigin-RevId: 355645297
2021-02-04 09:38:35 -08:00
Ayush Ranjan fa2d3698c4 [infra] Do not recompile integration test executables each time.
Instead build the executable into the image.

PiperOrigin-RevId: 355631672
2021-02-04 08:28:38 -08:00
Ayush Ranjan f2c881f684 [vfs] Make sticky bit check consistent with Linux.
Our implementation of vfs.CheckDeleteSticky was not consistent with Linux,
specifically not consistent with fs/linux.h:check_sticky().

One of the biggest differences was that the vfs implementation did not
allow the owner of the sticky directory to delete files inside it that belonged
to other users.

This change makes our implementation consistent with Linux.

Also adds an integration test to check for this. This bug is also present in
VFS1.

Updates #3027

PiperOrigin-RevId: 355557425
2021-02-03 22:44:51 -08:00
Tamir Duberstein 0dbc112979 Compile-time constants are constexpr
PiperOrigin-RevId: 355506299
2021-02-03 16:21:37 -08:00
Tamir Duberstein 52ad6ceeeb Remove gazelle noise patch
Confirmed gazelle generates no significant noise.

Fix documented gazelle invocation while I'm here.

PiperOrigin-RevId: 355452758
2021-02-03 12:14:28 -08:00
gVisor bot d1bb263b9b Merge pull request #5352 from weisdd:patch-1
PiperOrigin-RevId: 355449206
2021-02-03 12:00:49 -08:00
Nayana Bidari e3bce9689f Add a function to enable RACK in tests.
- Adds a function to enable RACK in tests.
- RACK update functions are guarded behind the flag tcpRecovery.

PiperOrigin-RevId: 355435973
2021-02-03 11:09:23 -08:00
gVisor bot d3113ad440 Merge pull request #5418 from amscanne:codespace
PiperOrigin-RevId: 355434313
2021-02-03 11:02:50 -08:00
gVisor bot 5106e66fdd Merge pull request #5373 from oke-py:docs
PiperOrigin-RevId: 355324521
2021-02-02 22:12:38 -08:00
Ayush Ranjan bfad3be0b7 Make ubuntutest image x86 only.
PiperOrigin-RevId: 355315140
2021-02-02 21:06:39 -08:00
Tamir Duberstein fb422db706 Update go-tools to 2020.2.1
...and a bunch of other things as I worked through the rot. Notably:
  - Upgrade to bazel 4.0.0
  - Upgrade to Go 1.15.7

Remove go_branch stderr suppression; this made it quite difficult to see
what was failing while developing this patch.

PiperOrigin-RevId: 355257833
2021-02-02 14:53:12 -08:00
Jamie Liu ff8b308a30 Remove call to Notify from pipe.VFSPipeFD.CopyOutFrom.
This was missed in cl/351911375; pipe.VFSPipeFD.SpliceFromNonPipe already calls
Notify.

PiperOrigin-RevId: 355246655
2021-02-02 14:01:22 -08:00
Zach Koopmans fcc2468db5 Add CPUSet for runsc mitigate.
PiperOrigin-RevId: 355242055
2021-02-02 13:40:46 -08:00
Nayana Bidari 49f783fb65 Rename HandleNDupAcks in TCP.
Rename HandleNDupAcks() to HandleLossDetected() as it will enter this when
is detected after:
- reorder window expires and TLP (in case of RACK)
- dupAckCount >= 3

PiperOrigin-RevId: 355237858
2021-02-02 13:21:40 -08:00
Kevin Krakauer 5f7bf31526 Stub out basic `runsc events --stat` CPU functionality
Because we lack gVisor-internal cgroups, we take the CPU usage of the entire pod
and divide it proportionally according to sentry-internal usage stats.

This fixes `kubectl top pods`, which gets a pod's CPU usage by summing the usage
of its containers.

Addresses #172.

PiperOrigin-RevId: 355229833
2021-02-02 12:47:23 -08:00
Adin Scannell f884ea13b7 Move ring0 package.
This allows the package to serve as a general purpose ring0 support package, as
opposed to being bound to specific sentry platforms.

Updates #5039

PiperOrigin-RevId: 355220044
2021-02-02 12:03:26 -08:00
Fabricio Voznika d6d169320c Add ETIMEDOUT to partial result list
Reported-by: syzbot+db8d83f93b84fcb84374@syzkaller.appspotmail.com
PiperOrigin-RevId: 355213994
2021-02-02 11:37:11 -08:00
Adin Scannell 017348af99 Drop gazelle target from the Makefile.
This is replaced with a straight call to bazel. Unfortunately,
the built gazelle target requires a bazel installation to run
anyways.

PiperOrigin-RevId: 355211990
2021-02-02 11:29:02 -08:00
Bhasker Hariharan 8c7c5abafb Add support for rate limiting out of window ACKs.
Netstack today will send dupACK's with no rate limit for incoming out of
window segments. This can result in ACK loops for example if a TCP socket
connects to itself (actually permitted by TCP). Where the ACK sent in
response to packets being out of order itself gets considered as an out
of window segment resulting in another ACK being generated.

PiperOrigin-RevId: 355206877
2021-02-02 11:05:28 -08:00
Adin Scannell 3817c7349d Remove go_tool_library references.
This is required only for the built-in bazel nogo functionality.
Since we roll these targets manually via the wrappers, we don't need
to use go_tool_library. The inconsistent use of these targets leads
to conflicting instantiations of go_default_library and go_tool_library,
which both contain the same output files.

PiperOrigin-RevId: 355184975
2021-02-02 09:37:09 -08:00
Tamir Duberstein 00d21b9ae0 Assert TCP_INFO size before checking content
Also sync syscall test expectations on Fuchisa.

PiperOrigin-RevId: 355163492
2021-02-02 07:45:47 -08:00
Adin Scannell 5fa683ffdf Minor page tables improvements.
* Make split safe.
* Enable looking up next valid address.
* Support mappings with !accessType.Any(), distinct from unmap.

These changes allow for the use of pagetables in low-level OS packages, such
as ring0, and allow for the use of pagetables for more generic address space
reservation (by writing entries with no access specified).

Updates #5039

PiperOrigin-RevId: 355109016
2021-02-02 00:10:19 -08:00
Adin Scannell 0c8cc66117 Fix empty Packages file for APT repository.
This change also adds an extra sanity check to the make_apt.sh script,
in order to ensure that this simple mistake does not occur again.

PiperOrigin-RevId: 355101754
2021-02-01 23:03:58 -08:00
Fabricio Voznika aae4803808 Enable container checkpoint/restore tests with VFS2
Updates #1663

PiperOrigin-RevId: 355077816
2021-02-01 19:29:29 -08:00
Nayana Bidari d3855ad6bd Add RACK reorder tests.
PiperOrigin-RevId: 355067082
2021-02-01 18:00:38 -08:00
Adin Scannell 5d8054e75a Remove Go cache on failure.
It's unclear why permissions wind up corrupted, but these can be cleared
on any failure, similar to the bazel cache itself:
  https://buildkite.com/gvisor/pipeline/builds/2304#_

PiperOrigin-RevId: 355057421
2021-02-01 17:00:58 -08:00
gVisor bot 5230c8e13c Merge pull request #5403 from avagin:syzkaller3
PiperOrigin-RevId: 355047815
2021-02-01 16:08:49 -08:00
Ayush Ranjan 0da3c72c9d [infra] Consolidate all ubuntu tests into one image.
This makes it easier to add more tests that run on Ubuntu. We can now just
add a bash script and call that from integration_test without having to set up
another image.

PiperOrigin-RevId: 355000410
2021-02-01 12:30:45 -08:00
Adin Scannell ea63a4e733 Ignore convenience symlink. 2021-02-01 20:30:16 +00:00
Adin Scannell 4fcf8b2282
Update .devcontainer.json
Provide appropriate capabilities and adjust Docker socket.
2021-02-01 12:16:48 -08:00
Adin Scannell 196c9de99e Add basic VSCode plumbing. 2021-02-01 20:08:00 +00:00
Ghanan Gowripalan ebd3912c0f Refactor HandleControlPacket/SockError
...to remove the need for the transport layer to deduce the type of
error it received.

Rename HandleControlPacket to HandleError as HandleControlPacket only
handles errors.

tcpip.SockError now holds a tcpip.SockErrorCause interface that
different errors can implement.

PiperOrigin-RevId: 354994306
2021-02-01 12:04:03 -08:00
Ayush Ranjan cbcebfea80 [infra] Fix gazelle target.
PiperOrigin-RevId: 354991724
2021-02-01 11:53:30 -08:00
Tamir Duberstein 726100f8eb Assert expected size before unmarshalling
...to prevent panicking in case of failure.

PiperOrigin-RevId: 354970257
2021-02-01 10:29:39 -08:00
Ghanan Gowripalan d930def27a Default to NUD/neighborCache instead of linkAddrCache
This change flips gvisor to use Neighbor unreachability detection by
default to populate the neighbor table as defined by RFC 4861 section 7.
Although RFC 4861 is targeted at IPv6, the same algorithm is used for
link resolution on IPv4 networks using ARP.

Integrators may still use the legacy link address cache by setting
stack.Options.UseLinkAddrCache to true; stack.Options.UseNeighborCache
is now unused and will be removed.

A later change will remove linkAddrCache and associated code.

Updates #4658.

PiperOrigin-RevId: 354850531
2021-01-31 18:48:26 -08:00
Ghanan Gowripalan c5e3c1c7bd Use closure for IPv6 testContext cleanup
PiperOrigin-RevId: 354827491
2021-01-31 13:47:57 -08:00
Ghanan Gowripalan b4f8a92528 Remove NICs before closing their link endpoints
...in IPv6 ICMP tests.

A channel link endpoint's channel is closed when the link endpoint is
closed.

When the stack tries to send packets through a NIC with a closed channel
endpoint, a panic will occur when attempting to write to a closed
channel (https://golang.org/ref/spec#Close). To make sure the stack does
not try to send packets through a NIC, we remove it.

PiperOrigin-RevId: 354822085
2021-01-31 12:27:21 -08:00
Ghanan Gowripalan 4ee8cf8734 Use different neighbor tables per network endpoint
This stores each protocol's neighbor state separately.

This change also removes the need for each neighbor entry to keep
track of their own link address resolver now that all the entries
in a cache will use the same resolver.

PiperOrigin-RevId: 354818155
2021-01-31 11:33:46 -08:00
Ghanan Gowripalan daeb06d2cb Hide neighbor table kind from NetworkEndpoint
The network endpoint should not need to have logic to handle different
kinds of neighbor tables. Network endpoints can let the NIC know about
differnt neighbor discovery messages and let the NIC decide which table
to update.

This allows us to remove the LinkAddressCache interface.

PiperOrigin-RevId: 354812584
2021-01-31 10:03:46 -08:00
Tamir Duberstein 8dda226542 Extract route table from Stack lock
PiperOrigin-RevId: 354746864
2021-01-30 17:53:41 -08:00
Fabricio Voznika ccf9138e6d Remove side effect from open tests
Individual test cases must not rely on being executed in a clean environment.

PiperOrigin-RevId: 354730126
2021-01-30 13:38:05 -08:00
Ghanan Gowripalan 2d90bc5480 Implement LinkAddressResolver on NetworkEndpoints
This removes the need to provide the link address request with the NIC
the request is being performed on since the NetworkEndpoints already
have a reference to the NIC.

PiperOrigin-RevId: 354721940
2021-01-30 11:37:29 -08:00
Andrei Vagin 44e0a0eac9 Add syzkaller docker image 2021-01-29 19:00:57 -08:00
Ting-Yu Wang 825c185dc5 Make fragmentation return a reassembled PacketBuffer
This allows later decoupling of the backing network buffer implementation.

PiperOrigin-RevId: 354643297
2021-01-29 17:37:29 -08:00
Ghanan Gowripalan 45fe9fe9c6 Clear IGMPv1 present flag on NIC down
This is dynamic state that can be re-learned when the NIC comes
back up.

Test: ipv4_test.TestIgmpV1Present
PiperOrigin-RevId: 354630921
2021-01-29 16:10:49 -08:00
Kevin Krakauer 66aa6f3d4f setgid directory syscall tests
PiperOrigin-RevId: 354615220
2021-01-29 14:49:04 -08:00
Fabricio Voznika fdbfd447a0 Remove side effect from test cases
Individual test cases must not rely on being executed in a clean environment.

PiperOrigin-RevId: 354604389
2021-01-29 13:56:17 -08:00
Ghanan Gowripalan 5e2edfb872 Refresh delayed report timers on query messages
...as per As per RFC 2236 section 3 page 3 (for IGMPv2) and
RFC 2710 section 4 page 5 (for MLDv1).

See comments in code for more details.

Test: ip_test.TestHandleQuery
PiperOrigin-RevId: 354603068
2021-01-29 13:49:38 -08:00
Nayana Bidari 0a52b64794 - Add more comments for the TCP_INFO struct fields.
PiperOrigin-RevId: 354595623
2021-01-29 13:15:57 -08:00
Fabricio Voznika 0fa534f116 Fix deadlock in specialFileFD.pwrite
When file is regular and metadata cache is authoritative, metadata lock
is taken. The code deadlocks trying to acquire the metadata lock
again to update time stampts.

PiperOrigin-RevId: 354584594
2021-01-29 12:18:42 -08:00