Commit Graph

2437 Commits

Author SHA1 Message Date
gVisor bot 9be46e55c2 Stateify: register types with full package names
This is to avoid conflicts with types that share the same
[short] package and type names, e.g. proc.smapsData exist
in pkg/sentry/fs/proc and pkg/sentry/fsimpl/proc.

Updates #1663

PiperOrigin-RevId: 294485146
2020-02-11 11:41:55 -08:00
Adin Scannell 115898e368 Prevent DATA RACE in UnstableAttr.
The slaveInodeOperations is currently copying the object when
truncate is called (which is a no-op). This may result in a
(unconsequential) data race when being modified concurrently.

PiperOrigin-RevId: 294484276
2020-02-11 11:38:08 -08:00
gVisor bot 762e4761cc Move Align{Up,Down} into binary package.
PiperOrigin-RevId: 294477647
2020-02-11 11:09:31 -08:00
gVisor bot 0dd9ee0d1e Merge pull request #1775 from kevinGC:tcp-matchers-submit
PiperOrigin-RevId: 294340468
2020-02-10 17:21:13 -08:00
Adin Scannell 71af006b6f Cleanup internal package group.
PiperOrigin-RevId: 294339229
2020-02-10 17:12:59 -08:00
Adin Scannell dc5a8e52d7 Rename build to builddefs and minor build clean-up.
The name 'bazel' also doesn't work because bazel will treat it specially.

Fixes #1807

PiperOrigin-RevId: 294321221
2020-02-10 15:45:17 -08:00
Dean Deng 475316e87d Refactor getxattr.
Put most of the logic for getxattr in one place for clarity. This simplifies
FGetXattr and getXattrFromPath, which are just wrappers for getXattr.

PiperOrigin-RevId: 294308332
2020-02-10 14:47:47 -08:00
Adin Scannell afcab8fe9f Clean-up comments in runsc/BUILD and CONTRIBUTING.md.
PiperOrigin-RevId: 294300437
2020-02-10 14:15:36 -08:00
Adin Scannell 2889ffa84e Add context to note.
PiperOrigin-RevId: 294300040
2020-02-10 14:11:52 -08:00
Adin Scannell 3e8b38d08b Add flag package to limit visibility.
PiperOrigin-RevId: 294297004
2020-02-10 13:57:01 -08:00
Adin Scannell a6f9361c2f Add context to comments.
PiperOrigin-RevId: 294295852
2020-02-10 13:52:09 -08:00
Adin Scannell bb22ebd7fb Add contextual comment.
PiperOrigin-RevId: 294289066
2020-02-10 13:21:30 -08:00
Brad Burlage bc504d5202 Fix build_file in runtimes_tests.
PiperOrigin-RevId: 294286242
2020-02-10 13:10:06 -08:00
Adin Scannell 4d4d47f0c0 Add contextual note.
PiperOrigin-RevId: 294285723
2020-02-10 13:05:27 -08:00
Adin Scannell c9a18b16ad Document MinimumTotalMemoryBytes.
PiperOrigin-RevId: 294273559
2020-02-10 12:08:32 -08:00
Fabricio Voznika bfa0bba72a Redirect FIXME to gvisor.dev
PiperOrigin-RevId: 294272755
2020-02-10 12:04:38 -08:00
Brad Burlage 20840bfec0 Move x86 state definition to its own file.
PiperOrigin-RevId: 294271541
2020-02-10 12:00:46 -08:00
Adin Scannell 0efa8168c7 Update visibility.
PiperOrigin-RevId: 294265019
2020-02-10 11:30:21 -08:00
Kevin Krakauer 31f2182cd3 iptables: add instructions for runsc building.
The readme didn't mention that users need to:
- `bazel build` when working on iptables tests
- enable raw sockets in /etc/docker/daemon.json.

PiperOrigin-RevId: 294260169
2020-02-10 11:09:19 -08:00
gVisor bot a03b40ca17 Merge pull request #1453 from xiaobo55x:cpuid
PiperOrigin-RevId: 294257911
2020-02-10 11:01:08 -08:00
Nicolas Lacasse 223931da84 Bump rules_go, gazelle, and go toolchain.
PiperOrigin-RevId: 294253155
2020-02-10 10:42:15 -08:00
Zach Koopmans 75412ed9f5 Internal change.
PiperOrigin-RevId: 294250370
2020-02-10 10:29:57 -08:00
Zach Koopmans 724bafa094 Fix wrong path for ruby benchmark.
PiperOrigin-RevId: 294224689
2020-02-10 08:28:58 -08:00
Haibo Xu 9cbf5a3dcc Enable pkg/cpuid support on arm64.
Fixes #1255

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I8614e6f3ee321c2989567e4e712aa8f28cc9db14
2020-02-10 02:46:05 +00:00
Dean Deng 17b9f5e662 Support listxattr and removexattr syscalls.
Note that these are only implemented for tmpfs, and other impls will still
return EOPNOTSUPP.

PiperOrigin-RevId: 293899385
2020-02-07 14:47:13 -08:00
Ian Gudger e1587a2887 Log level, optname, optval and optlen in getsockopt/setsockopt in strace.
Log 8, 16, and 32 int optvals and dump the memory of other sizes.

Updates #1782

PiperOrigin-RevId: 293889388
2020-02-07 14:01:47 -08:00
Kevin Krakauer c141eb5f43 Address GH comments. 2020-02-07 13:47:57 -08:00
Jay Zhuang 6de49546cb Refactor syscall tests
- Move shared helpers V4Multicast and V4Broadcast to socket_test_util
- Add unnamed namespace so socket_ipv4_tcp_unbound_external_networking_test.cc
  and socket_ipv4_udp_unbound_external_networking_test.cc can be compiled
  together
- Add test files to "exports_files" so they can be included by Fuchsia's syscall
  test setup

PiperOrigin-RevId: 293880429
2020-02-07 13:19:18 -08:00
Ghanan Gowripalan ca30dfa065 Send DAD event when DAD resolves immediately
Previously, a DAD event would not be sent if DAD was disabled.

This allows integrators to do some work when an IPv6 address is bound to
a NIC without special logic that checks if DAD is enabled.

Without this change, integrators would need to check if a NIC has DAD
enabled when an address is auto-generated. If DAD is enabled, it would
need to delay the work until the DAD completion event; otherwise, it
would need to do the work in the address auto-generated event handler.

Test: stack_test.TestDADDisabled
PiperOrigin-RevId: 293732914
2020-02-06 19:50:34 -08:00
Ting-Yu Wang 386a1a1564 Fix TestPauseResume in container test failed with connection refused.
Sometimes we get this error under TSAN:
"""
error getting process data from container: connecting to control server at PID
XXXX: connection refused
"""

The theory is that the top "sleep 20" was too short for TSAN, and the container
already exited, so we get connected refused. This commit changes the test to
let container signaling it's running by touching a file repeatedly forever
during the test.

PiperOrigin-RevId: 293710957
2020-02-06 17:07:07 -08:00
Kevin Krakauer d98287f5eb Merge branch 'master' into tcp-matchers-submit 2020-02-06 17:07:04 -08:00
Ghanan Gowripalan 3700221b1f Auto-generate link-local address as a SLAAC address
Auto-generated link-local addresses should have the same lifecycle hooks
as global SLAAC addresses.

The Stack's NDP dispatcher should be notified when link-local addresses
are auto-generated and invalidated. They should also be removed when a
NIC is disabled (which will be supported in a later change).

Tests:
- stack_test.TestNICAutoGenAddrWithOpaque
- stack_test.TestNICAutoGenAddr
PiperOrigin-RevId: 293706760
2020-02-06 16:43:39 -08:00
Zach Koopmans 16561e461e Add logic to run from baked images.
Change adds the following:
- logic to run from "baked images". See [GVISOR_DIR]/tools/images
- installers which install modified files from a workspace. This
allows users to run benchmarks while modifying runsc.
- removes the --preemptible tag from built GCE instances. Preemptible
instances are much more likely to be preempted on startup, which
manifests for the user as a failed benchmark. I don't currently have
a way to detect if a VM has been preempted that will work for this
change.
https://cloud.google.com/compute/docs/instances/preemptible#preemption_process
https://cloud.google.com/compute/docs/instances/preemptible#preemption_selection

PiperOrigin-RevId: 293697949
2020-02-06 16:02:48 -08:00
Ghanan Gowripalan 940d255971 Perform DAD on IPv6 addresses when enabling a NIC
Addresses may be added before a NIC is enabled. Make sure DAD is
performed on the permanent IPv6 addresses when they get enabled.

Test:
- stack_test.TestDoDADWhenNICEnabled
- stack.TestDisabledRxStatsWhenNICDisabled
PiperOrigin-RevId: 293697429
2020-02-06 15:58:16 -08:00
Kevin Krakauer bfa4a235f4 Fix `bazel run` target in docs.
PiperOrigin-RevId: 293676954
2020-02-06 14:27:31 -08:00
Ian Gudger 736775e0ac Make gonet consistent both internally and with the net package.
The types gonet.Conn and gonet.PacketConn were confusingly named as both
implemented net.Conn. Further, gonet.Conn was perhaps unexpectedly
TCP-specific (net.Conn is not). This change renames them to gonet.TCPConn and
gonet.UDPConn.

Renames gonet.NewListener to gonet.ListenTCP and adds a new gonet.NewTCPListner
function to be consistent with both the gonet.DialXxx and gonet.NewXxxConn
functions as well as net.ListenTCP.

Updates #1632

PiperOrigin-RevId: 293671303
2020-02-06 14:07:04 -08:00
Andrei Vagin 615d661112 runsc/container_test: hide host /etc in test containers
The host /etc can contain config files which affect tests.

For example, bash reads /etc/passwd and if it is too big
a test can fail by timeout.

PiperOrigin-RevId: 293670637
2020-02-06 14:02:52 -08:00
Ghanan Gowripalan 6bd59b4e08 Update link address for targets of Neighbor Adverts
Get the link address for the target of an NDP Neighbor Advertisement
from the NDP Target Link Layer Address option.

Tests:
- ipv6.TestNeighorAdvertisementWithTargetLinkLayerOption
- ipv6.TestNeighorAdvertisementWithInvalidTargetLinkLayerOption
PiperOrigin-RevId: 293632609
2020-02-06 11:13:29 -08:00
Adin Scannell 0e96fcafd4 Fix test case on AMD.
When ignored, the trap should be executed which generates
a SIGSEGV as in the above case.

PiperOrigin-RevId: 293618489
2020-02-06 10:12:16 -08:00
Andrei Vagin 5ff780891e Move p9.pool to a separate package
PiperOrigin-RevId: 293617493
2020-02-06 10:07:45 -08:00
Adin Scannell 1b6a12a768 Add notes to relevant tests.
These were out-of-band notes that can help provide additional context
and simplify automated imports.

PiperOrigin-RevId: 293525915
2020-02-05 22:46:35 -08:00
Eyal Soha f3d9560703 recv() on a closed TCP socket returns ENOTCONN
From RFC 793 s3.9 p58 Event Processing:

If RECEIVE Call arrives in CLOSED state and the user has access to such a
connection, the return should be "error: connection does not exist"

Fixes #1598

PiperOrigin-RevId: 293494287
2020-02-05 17:56:42 -08:00
Kevin Krakauer bf0ea204e9 Merge branch 'master' into tcp-matchers-submit 2020-02-05 14:43:11 -08:00
Brad Burlage f2d3efca1d Fix undeclared variable error in common_build.sh.
PiperOrigin-RevId: 293413711
2020-02-05 11:34:46 -08:00
Nicolas Lacasse eea0eeee93 Disable get/set xattrs until list/remove exist too.
PiperOrigin-RevId: 293411655
2020-02-05 11:26:19 -08:00
Eyal Soha 37abbbc547 Add packetdrill tests to presubmit and CI testing
PiperOrigin-RevId: 293409718
2020-02-05 11:18:02 -08:00
Ting-Yu Wang 665b614e4a Support RTM_NEWADDR and RTM_GETLINK in (rt)netlink.
PiperOrigin-RevId: 293271055
2020-02-04 18:05:03 -08:00
gVisor bot b29aeebaf6 Merge pull request #1683 from kevinGC:ipt-udp-matchers
PiperOrigin-RevId: 293243342
2020-02-04 16:20:16 -08:00
Ian Gudger a26a954946 Add socket connection stress test.
Tests 65k connection attempts on common types of sockets to check for port
leaks.

Also fixes a bug where dual-stack sockets wouldn't properly re-queue
segments received while closing.

PiperOrigin-RevId: 293241166
2020-02-04 15:54:49 -08:00
Kevin Krakauer 3f5642c5af Increase container_test size.
container_test was flaking because a small percentage of runs timed out. Tested
this fix with --runs_per_test=100.

PiperOrigin-RevId: 293240102
2020-02-04 15:38:53 -08:00