Commit Graph

2995 Commits

Author SHA1 Message Date
Dmitry Vyukov
23db2ea6f9 vm/vmm: fix fd leaks
Close pipe fd's on failure paths.
Don't close outr because OutputMerger closes all passed in fd's.
2018-09-20 14:54:03 +02:00
Dmitry Vyukov
88f20b7bcc vm/vmm: increase timeouts
A dozen of vmm's running on a GCE machine can be really slow to boot.
Timeouts have only single goal: preventing complete system stalls
when/if external commands episodically hang. There is no value
in keeping them as close as possible to expected durations.
This can only lead to various flakes. Increase timeouts by an
order of magnitude.
2018-09-20 14:53:59 +02:00
Dmitry Vyukov
d1086008f6 vm/vmm: properly shutdown output reading goroutine
The goroutine sends on bootOutputStop to notify about its completion,
but the main goroutine is not receiving from the chan on success
and since the chan in unbuffered, the output reading goroutine
hangs on the send forever.
2018-09-20 14:53:56 +02:00
Dmitry Vyukov
3af0330c9e vm/vmm: make more robust after restarts
Instances from the previous run can still be running,
so always stop the previous instances before starting new ones.
2018-09-20 14:53:52 +02:00
Dmitry Vyukov
1c10e8337a vm/vmm: don't prefix vm name with syzkaller
I am getting:
failed to run vmctl -name syzkaller-ci-openbsd-main-test-0
vmctl: name too long

The name is auto-generated from parts which ensure that it is unique.
We can't easily name it shorter. So strip the syzkaller prefix,
which is not strictly necessary.
2018-09-20 14:53:48 +02:00
Dmitry Vyukov
845e8c5895 vm/vmm: remove cpu parameter, make template optional
CPU is not used. Remove it.
Template is not strictly necessary. Make it optional.
2018-09-20 14:53:44 +02:00
Dmitry Vyukov
a6a09fb2a0 vm/vmm: increase maximum number of VMs
8 is way too low. A modern beefy machine can host a hundred of VMs freely.
Make the limit consistent for all of qemu/kvm/gvisor/vmm and set it to 128.
2018-09-20 14:53:40 +02:00
Dmitry Vyukov
6c662d569b executor: fix build
Move debug_dump_data back to executor.cc.
debug_dump_data in common_linux.h does not play well
with pkg/csource debug stripping logic. It strips a large
random piece of code since it thinks debug_dump_data
definition is actually debug_dump_data call site.
2018-09-20 14:46:58 +02:00
Dmitry Vyukov
5adbd06eff syz-manager: improve coverage source file path generation
If we don't determine correct prefix (e.g. some paths are not full paths),
we can plumb kernel source path twice. It seems that it's not possible
to do the right thing in all possible combinations of what can be in
debug info, if the kernel sources were moved or not, if we have kernel_src
or not. But at least don't plumb kernel_src second time.
2018-09-20 11:22:57 +02:00
Dmitry Vyukov
0415891efa syz-ci: enable net/http/pprof
Useful to have for all servers.
2018-09-20 11:22:33 +02:00
Dmitry Vyukov
bc83c27668 Makefile: test openbsd build 2018-09-20 11:21:57 +02:00
Dmitry Vyukov
02d481205b Makefile: format openbsd syscall descriptions 2018-09-20 11:21:51 +02:00
Dmitry Vyukov
a0da096399 executor: fix build
Fix build after "executor: remove unused var flag_sandbox_privs".
Some variables/functions can't be static as they are unused on some OSes,
which produces unused warnings.
2018-09-20 11:18:34 +02:00
Dmitry Vyukov
8eb14a0057 syz-fuzzer: fix retry logic on executor failures
I guess the condition was always meant to be "!ok || try > 10".
So we always ignored non-executor failures, and failed on executor ones.
I think now it's better to just retry always. If the error is something
persistent we will fail after 10 tries anyway.
2018-09-20 11:17:25 +02:00
Anton Lindqvist
5f78ab4b81 executor: move debug_dump_data() into common_linux.h
Compiling the executor on OpenBSD currently fails:

  executor/executor.cc:1316:6: error: unused function 'debug_dump_data'
2018-09-20 11:17:14 +02:00
Alexander Potapenko
25ff1e17d3 dashboard/config: update upstream-kmsan.config to v4.19-rc4
The previous version has accidentally disabled many configs that were previously enabled on syzbot.
2018-09-20 11:10:38 +02:00
Greg Steuck
b117b6ed3d tools/*openbsd*: smaller VMM images and tweaks. 2018-09-20 11:03:43 +02:00
Tobias Klauser
7f7e03fda2 sys/linux: add MFD_HUGETLB 2018-09-19 13:43:38 +02:00
Tobias Klauser
fe944bbcd7 sys/linux: add MCL_ONFAULT 2018-09-19 13:21:09 +02:00
Anton Lindqvist
d39675eb1c docs/openbsd: add missing template directive to example configuration 2018-09-19 07:57:06 +02:00
Alexander Potapenko
5959df5cd2
Update upstream-kmsan.config to 4.19.0-rc3
Also ensure CONFIG_DRM_AMD_DC is off.
2018-09-18 12:01:20 +02:00
Dmitry Vyukov
573fd11272 executor: remove unused var flag_sandbox_privs
Remove unused var flag_sandbox_privs (which was used for what?).
Decleare all variables as static to detect such cases in future.
2018-09-17 11:50:39 +02:00
Dmitry Vyukov
98f4a9612d executor: make sandboxes more modular
Currently we have a global fixed set of sandboxes,
which makes it hard to add new OS-specific ones
(all OSes need to updated to say that they don't
support this sandbox).
Let it each OS say what sandboxes it supports instead.
2018-09-17 11:39:04 +02:00
Zach Riggle
0eca949a6c RFC: android: Add support for untrusted_app sandboxing (#697)
executor: add support for android_untrusted_app sandbox

This adds a new sandbox type, 'android_untrusted_app', which restricts
syz-executor to the privileges which are available to third-party applications,
e.g. those installed from the Google Play store.

In particular, this uses the UID space reserved for applications (instead of
the 'setuid' sandbox, which uses the traditional 'nobody' user / 65534)
as well as a set of groups which the Android-specific kernels are aware of,
and finally ensures that the SELinux context is set appropriately.

Dependencies on libselinux are avoided by manually implementing the few
functions that are needed to change the context of the current process,
and arbitrary files.  The underlying mechanisms are relatively simple.

Fixes google/syzkaller#643

Test: make presubmit
Bug: http://b/112900774
2018-09-17 11:33:11 +02:00
Dmitry Vyukov
fd85ed4885 pkg/runtest, pkg/csource: don't run tests on openbsd
The tests are currently broken on openbsd.
2018-09-17 10:59:06 +02:00
Dmitry Vyukov
2c2e5f7129 sys/targets: use native compiler for test OS
We used to use gcc for test OS, but this is linux-specific.
Other OSes may use c++ or clang as main compiler, so use whatever
is the default for the host OS.

Update #712
2018-09-17 10:53:29 +02:00
Dmitry Vyukov
2e81ad1926 pkg/symbolizer: skip nm tests on non-linux
The test fails on openbsd, and probably everything else other than linux.
2018-09-17 10:53:13 +02:00
Dmitry Vyukov
a0be1d1210 pkg/build: copy image to output dir
For vmm we need a pre-created image.
So if one is provided in the userspace dir,
copy it to output. This should be enough
to get vmm working.

Update #712
2018-09-17 10:53:06 +02:00
Dmitry Vyukov
3805b76483 syz-ci: make goroot optional
If not set, syz-ci will use the system go.

Update #712
2018-09-17 10:51:17 +02:00
Dmitry Vyukov
7819680a0b vm/vmm: enable network
Without -L local interface vio0 is not enabled
and we can't connect to the machine.

Update #712
2018-09-17 10:51:00 +02:00
Anton Lindqvist
ffd521cac9 docs/openbsd: update instructions on kernel compilation 2018-09-17 10:49:33 +02:00
Anton Lindqvist
43f25323dc pkg/build: OpenBSD support, currently limited to building a kcov enabled kernel 2018-09-17 10:49:33 +02:00
Anton Lindqvist
e9b51a9024 pkg/build: fix typo in error messages 2018-09-17 10:49:33 +02:00
Greg Steuck
7f125108ae More packages and fewer daemons. 2018-09-17 09:44:01 +02:00
Greg Steuck
68def56dce tools/create-openbsd-gce-ci.sh: Add VMM configuration.
Added verification of successful package install.
2018-09-17 09:44:01 +02:00
Dokyung Song
a343a4003c sys/fuchsia: add description for fuchsia.net, .net-stack, .ldsvc services 2018-09-14 12:03:48 +02:00
Dmitry Vyukov
19e9088bb7 syz-ci: use gmake instead of make on openbsd
Update #712
2018-09-13 12:13:54 +02:00
Dmitry Vyukov
61ed43a86a sys/linux: prohibit EXT4_IOC_SHUTDOWN
EXT4_IOC_SHUTDOWN EXT4_IOC_SHUTDOWN on root fs effectively brings the machine down in weird ways.
2018-09-13 12:02:45 +02:00
Dmitry Vyukov
0e29942f77 pkg/report: improve KMSAN report parsing
Extract guilty frame from stack.
Add few more ignored functions.
Add more tests.
2018-09-13 11:21:29 +02:00
Dokyung Song
71907dafdb sys/fuchsia: generate descriptions for garnet services 2018-09-12 11:08:31 +02:00
Dmitry Vyukov
3c88136c8a sys/linux: add btf descriptions
Add some new bpf descriptions, most notably btf.
Not perfect, but something.
2018-09-11 18:44:54 +02:00
Dmitry Vyukov
4ae17b1f4c pkg/instance: support injected boot for vmm
If pkg/build produces a kernel, inject it into vmm config too.
This will allow continuous build with vmm VM type.

Update #712
2018-09-11 16:10:50 +02:00
Dmitry Vyukov
ff2962ae80 syz-ci: de-hardcode kernel object file names
We used to have this list in syz-ci and syz-managers.
Now we have kernel object in sys/targets, so use it instead.

Update #712
2018-09-11 15:43:55 +02:00
Dmitry Vyukov
a54c2b7b92 syz-ci: de-hardcode list of VMs that support overcommit
We currently have this list in multiple places (somewhat diverged).
Specify this "overcommit" property in VM implementations.
In particular, we also want to allow overcommit for "vmm" type.

Update #712
2018-09-11 15:33:45 +02:00
Dmitry Vyukov
472947468d pkg/vcs: add openbsd support
This just says that we want to use git to checkout OpenBSD
without any special/complex features.

Update #712
2018-09-11 14:47:38 +02:00
Dmitry Vyukov
20c13d3ce5 sys/fuchsia: regerenate files
Regerenate files after the previous commit.
2018-09-11 13:02:56 +02:00
Dokyung Song
11c256cdcd sys/fuchsia: prune unused structs in syscall description generated by fidlgen
After generating syscall description for fidl files using fidlgen, prune
all unused structs using the exact same mechanism used by the compiler's
check for unused structs. This allows the FIDL compiler to support
modular compilation; it does not need to have global knowledge of
whether each struct is used or not.
2018-09-11 13:01:53 +02:00
Dmitry Vyukov
e3d1d545d3 executor: reset oom_score_adj for test process
oom_score_adj is inherited, so we need to reset it to 0.
2018-09-11 12:39:25 +02:00
Dmitry Vyukov
a171414b74 dashboard/app: allow some cross-reporting dups
Allow a special case of cross-reporting duping:
rom last but one reporting to the last one (which is stable, final destination)
provided that these two reportings have the same access level and type.
The rest of the combinations can lead to surprising states and
information hiding, so we still don't allow them.

Fixes #569
2018-09-11 11:39:41 +02:00
Tobin C. Harding
c1b59a23a0 Add Tobin to CONTRIBUTORS
Prior to raising first PR add 'Tobin Harding' to CONTRIBUTORS as directed by
contributing.md.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
2018-09-11 07:06:01 +02:00