Commit Graph

2893 Commits

Author SHA1 Message Date
gVisor bot 7ec2397235 Merge pull request #2289 from xiaobo55x:syscall_cleanup
PiperOrigin-RevId: 306303148
2020-04-13 13:57:23 -07:00
gVisor bot e1959f58dc Merge pull request #2321 from lubinszARM:pr_nogo
PiperOrigin-RevId: 306300032
2020-04-13 13:41:45 -07:00
Dean Deng 5d885d7fb2 Port socket-related syscalls to VFS2.
Note that most kinds of sockets are not yet supported in VFS2
(only Unix sockets are partially supported at the moment), so
these syscalls will still generally fail. Enabling them allows
us to begin running socket tests for VFS2 as more features are
ported over.

Updates #1476, #1478, #1484, #1485.

PiperOrigin-RevId: 306292294
2020-04-13 13:02:34 -07:00
Adin Scannell aa75a3da51 Fix build.sh and VM targets.
PiperOrigin-RevId: 306289643
2020-04-13 12:48:38 -07:00
Jon Budd 6a4d17a31d Remove obsolete TODOs for b/38173783
The comments in the ticket indicate that this behavior
is fine and that the ticket should be closed, so we shouldn't
need pointers to the ticket.

PiperOrigin-RevId: 306266071
2020-04-13 11:02:14 -07:00
Jamie Liu 445c366581 Fix VFS2 getdents()/getdents64() alignment.
PiperOrigin-RevId: 306263615
2020-04-13 10:52:22 -07:00
Eyal Soha ef0b5584e5 Refactor parser to use a for loop instead of recursion.
This makes the code shorter and less repetitive.

TESTED:
  All unit tests still pass.
PiperOrigin-RevId: 306161475
2020-04-12 18:33:23 -07:00
Eyal Soha 2020349468 Improve error messages when parsing headers.
Tested:
  Looked at output of failing tests.
PiperOrigin-RevId: 306031407
2020-04-11 06:46:27 -07:00
Ian Lewis daf3322498 Add logging message for noNewPrivileges OCI option.
noNewPrivileges is ignored if set to false since gVisor assumes that
PR_SET_NO_NEW_PRIVS is always enabled.

PiperOrigin-RevId: 305991947
2020-04-10 20:32:23 -07:00
Dean Deng 09ddb5a426 Port extended attributes to VFS2.
As in VFS1, we only support the user.* namespace. Plumbing is added to tmpfs
and goferfs.
Note that because of the slightly different order of checks between VFS2 and
Linux, one of the xattr tests needs to be relaxed slightly.

Fixes #2363.

PiperOrigin-RevId: 305985121
2020-04-10 19:02:55 -07:00
Fabricio Voznika 96f9142959 Use O_CLOEXEC when dup'ing FDs
The sentry doesn't allow execve, but it's a good defense
in-depth measure.

PiperOrigin-RevId: 305958737
2020-04-10 15:47:23 -07:00
Nicolas Lacasse ca868e3e38 Automated rollback of changelist 305940483
PiperOrigin-RevId: 305944892
2020-04-10 14:29:01 -07:00
Nicolas Lacasse 99056b6bd6 Upgrade Kokoro and RBE to bazel 3.0.0
PiperOrigin-RevId: 305940483
2020-04-10 14:04:07 -07:00
Nicolas Lacasse 82dfc406e2 Automated rollback of changelist 305922105
PiperOrigin-RevId: 305927989
2020-04-10 12:53:17 -07:00
Nicolas Lacasse 76c4314c4f Install Bazel 3.0.0 on Kokoro image.
PiperOrigin-RevId: 305922105
2020-04-10 12:23:10 -07:00
Dean Deng 8bb8027d55 Return EIO from p9 if sending/receiving fails.
Continues the modifications in cl/272963663. This prevents non-syscall errors
from being propogated to kernel/task_syscall.go:ExtractErrno(), which causes a
sentry panic.

PiperOrigin-RevId: 305913127
2020-04-10 11:36:57 -07:00
Fabricio Voznika 1798d6cbee Remove TODO from kernel.Stracer
The dependency strace=>kernel grew over time. strace also depends on
task's FD table and FSContext. It could be fixed with some interfaces
the other way, but then we're trading an interface for another, and
kernel.Stracer is likely cleaner.

Closes #155

PiperOrigin-RevId: 305909678
2020-04-10 11:19:12 -07:00
Eyal Soha 12b00c8156 Test that RST is sent after ABORT in ESTABLISHED TCP state.
PiperOrigin-RevId: 305879441
2020-04-10 08:22:09 -07:00
Andrei Vagin 935007937c test: remove 1s delay after non-blocking socket pair accept
It was added in cl/201419897 to deflake
socket_ip_tcp_loopback_non_blocking_test_gvisor.
It seems we don't need this hack, because the origin issue isn't
reproducible without this hack.

PiperOrigin-RevId: 305871748
2020-04-10 07:14:35 -07:00
gVisor bot 78126611e6 Merge pull request #2253 from amscanne:nogo
PiperOrigin-RevId: 305807868
2020-04-09 19:16:46 -07:00
Haibo Xu 7aa5caae71 Enable syscall ptrace test on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I5bb8fa7d580d173b1438d6465e1adb442216c8fa
2020-04-10 10:00:26 +08:00
Haibo Xu 35e6b6bf1a Enable syscall fork_test on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I033692bcf4f8139df29e369a12b150d10fccbe32
2020-04-10 09:39:50 +08:00
Ghanan Gowripalan c560bfd1a8 Drop invalid NDP NS messages
Better validate NDP NS messages and their options before doing work in
response to them. Also make sure that NA messages sent in response to
an NS use the correct IPv6 and link-layer addresses so they are
routed properly and received by the right node.

Test: stack_test.TestNeighorSolicitationResponse
PiperOrigin-RevId: 305799054
2020-04-09 18:04:42 -07:00
Ting-Yu Wang c9195349c9 Replace type assertion with TaskFromContext.
This should fix panic at aio callback.

PiperOrigin-RevId: 305798549
2020-04-09 18:00:33 -07:00
Jamie Liu 257225c34b Downgrade VFS1-specific FIXME to a NOTE.
PiperOrigin-RevId: 305794509
2020-04-09 17:30:51 -07:00
Fabricio Voznika 2a28e3e9c3 Don't unconditionally set --panic-signal
Closes #2393

PiperOrigin-RevId: 305793027
2020-04-09 17:20:14 -07:00
Fabricio Voznika 9f87502b46 Remove TODOs from Async IO
Block and drain requests in io_destroy(2).
Note the reason to create read-only mapping.

PiperOrigin-RevId: 305786312
2020-04-09 16:41:27 -07:00
Ting-Yu Wang ace90f823c Make some functions in IfAddrHelper const.
PiperOrigin-RevId: 305782490
2020-04-09 16:22:02 -07:00
Nicolas Lacasse 5b41f33642 Remove "no-sandbox" tag.
It seems no longer necessary.

PiperOrigin-RevId: 305758572
2020-04-09 14:18:49 -07:00
Nicolas Lacasse 9a5e5ab2fa Bump rule_go, bazel toolchain, and go toolchain versions.
PiperOrigin-RevId: 305751225
2020-04-09 13:42:10 -07:00
Ting-Yu Wang 64c2b49067 Dedup netlink utility functions in tests.
PiperOrigin-RevId: 305749697
2020-04-09 13:34:31 -07:00
Dean Deng 2b4687a46b Handle os.LinkError in p9/handlers.go.
PiperOrigin-RevId: 305721329
2020-04-09 11:17:11 -07:00
Jamie Liu 8f68be7491 Don't use REP string instructions in safecopy.memcpy.
PiperOrigin-RevId: 305718392
2020-04-09 11:03:43 -07:00
Andrei Vagin 7928aa345e Convert int and bool socket options to use GetSockOptInt and GetSockOptBool
PiperOrigin-RevId: 305699233
2020-04-09 09:31:48 -07:00
Andrei Vagin 1ebfdcc86c kokoro: fix handling of apt-get errors
When a command is called as if expression, its error
code can be get only in this if block.

For example, the next script prints 0:

if ( false ); then
  true
fi
echo $?

PiperOrigin-RevId: 305638629
2020-04-09 01:12:27 -07:00
Bin Lu ab54d4f496 remove nogo exemption for machine_arm64_unsafe.go
Minimize the use of unsafe.

Signed-off-by: Bin Lu <bin.lu@arm.com>
2020-04-09 03:54:58 -04:00
gVisor bot 21e438d257 Dereference pointers in Layer's Stringer impl
Dereference any fields which are pointers before string formatting so that the
value pointed to ends up in the string representation.

Tested:
  Added TestLayerStringFormat to
  //third_party/gvisor/test/packetimpact/testbench:testbench_test
PiperOrigin-RevId: 305627821
2020-04-08 23:30:09 -07:00
Andrei Vagin a10389e783 splice: cap splice calls to MAX_RW_COUNT
The Linux does the same.

Reported-by: syzbot+e81716e8956e92e9d56b@syzkaller.appspotmail.com
PiperOrigin-RevId: 305625439
2020-04-08 23:03:12 -07:00
Jamie Liu 7297fd7238 Bump proc_test's kRSSTolerance to 10MB.
PiperOrigin-RevId: 305604557
2020-04-08 19:41:43 -07:00
Jamie Liu 0f75f7273d Don't call platform.AddressSpace.MapFile with no permissions.
PiperOrigin-RevId: 305598136
2020-04-08 18:42:05 -07:00
Fabricio Voznika 6dd5a1f3fe Clean up TODOs
PiperOrigin-RevId: 305592245
2020-04-08 17:58:13 -07:00
Dean Deng 981a587476 Remove InodeOperations FIXMEs that will be obsoleted by VFS2.
PiperOrigin-RevId: 305588941
2020-04-08 17:34:02 -07:00
Dean Deng 357f136e42 Handle utimes correctly for shared gofer filesystems.
Determine system time from within the sentry rather than relying on the remote
filesystem to prevent inconsistencies.
Resolve related TODOs; the time discrepancies in question don't exist anymore.

PiperOrigin-RevId: 305557099
2020-04-08 14:39:25 -07:00
Ting-Yu Wang 2907e6da5e file test: Remove FIXME about FIFO. It is already tested in mknod test.
PiperOrigin-RevId: 305546584
2020-04-08 13:48:09 -07:00
Jamie Liu d8c0c1d9d5 Do not hold FileDescription references in VFS2 procfs inodes.
FileDescription references are side-effectual; for example, holding a reference
on the write end of a pipe prevents reads from the read end from returning EOF.

This change is consistent with Linux, but not VFS1; while VFS1 also has this
bug, it's less visible there since VFS1 procfs disables caching.

Updates #1195

PiperOrigin-RevId: 305545099
2020-04-08 13:40:27 -07:00
Fabricio Voznika b30130567d Enable SubprocessExited and SubprocessZombie for gVisor
Updates #164

PiperOrigin-RevId: 305544029
2020-04-08 13:34:44 -07:00
Adin Scannell 867eeb18d8 Remove lostcancel warnings.
Updates #2243
2020-04-08 10:14:34 -07:00
Adin Scannell f888b9ce83 Fix unused result errors.
This fixes a bug in the proc net directory.

Updates #2243
2020-04-08 10:14:34 -07:00
Adin Scannell 928a7c60b8 Fix all printf formatting errors.
Updates #2243
2020-04-08 10:14:34 -07:00
Adin Scannell 94b793262d Fix all copy locks violations.
This required minor restructuring of how system call tables were saved
and restored, but it makes way more sense this way.

Updates #2243
2020-04-08 10:00:14 -07:00