Commit Graph

763 Commits

Author SHA1 Message Date
Scott Graham
5f818b4b9f executor: Fuchsia: Use zx_task_resume_from_exception()
zx_task_resume() is deprecated; switch to using
zx_task_resume_from_exception() instead.
2018-10-10 19:45:24 +02:00
Dmitry Vyukov
ba8cd6d708 pkg/report: ignore arch/.*/mm/physaddr.c as guilty file
This is called from kfree in the added test.
We already ignore everything related to kmalloc/free
and e.g. arch/.*/mm/fault.c, so it looks reasonable
to ignore this one too.
2018-10-10 17:32:28 +02:00
Dmitry Vyukov
a9495352a0 pkg/host: improve KMEMLEAK detection
EBUSY is returned when KMEMLEAK is in fact turned off,
not when scanning is already turned off.
That can't be recovered.
So instead check that we can write to the file in the check
function and give useful diagnostics.
2018-10-10 15:38:06 +02:00
Dmitry Vyukov
adedaf77a1 executor: tune memcg container logic
The current memcg container seems to lead to lots of hangs/stalls.
Presumably the problem is with oom_score_adj and KASAN.
Executor process tree eats all memory and then the leaf process is killed
but the memory is not returned to memcg due to KASAN quarantine;
and the parent processes are protected from killing with oom_score_adj=-1000.
As the result the kernel locks up.

1. Don't use oom_score_adj=-1000. Instead bump leaf process score to 1000 (kill always).
2. Increase size of memcg to be larger than expected KASAN quarantine size.
2018-10-10 14:22:09 +02:00
Dmitry Vyukov
41e4b32952 pkg/report: ignore printk as guilty file 2018-09-28 16:46:41 +02:00
Dmitry Vyukov
7296c0747f pkg/host: improve KMEMLEAK support
Rewind kmemleak fd before reading it second time,
otherwise we will read truncated reports.

Auto-learn what leak reports we've already seen
and ignore them in future. This is required because
there are some false positives and some fire too frequently.
So now we will hit each leak only once per manager run,
but we still will try to reproduce them.
2018-09-28 14:57:20 +02:00
Dmitry Vyukov
a6143bc982 pkg/report: improve KMEMLEAK report parsing
Skip few more common allocation functions.
2018-09-28 14:57:20 +02:00
Dmitry Vyukov
0c2fa87bc6 executor: fix build on newer linux distros
This sucks a lot, but ebtables.h is now broken too on Debian 4.17:

ebtables.h: In function ‘ebt_entry_target* ebt_get_target(ebt_entry*)’:
ebtables.h:197:19: error: invalid conversion from ‘void*’ to ‘ebt_entry_target*’
2018-09-27 15:34:52 +02:00
Dmitry Vyukov
98b28ead6c pkg/report: fix few fuzz bugs
Improve go-fuzz fuzzer function and fix few new bugs it finds:
1. Panic in linux parser (bad).
2. Akaros can report empty rep.Report.
3. Fuchsia can return empty rep.Report.
2018-09-27 12:50:25 +02:00
Dmitry Vyukov
8899d58437 tools/create-gce-image.sh: mount securityfs and configfs 2018-09-26 14:06:11 +02:00
Dmitry Vyukov
db716d6653 pkg/report: fix guilty file extraction
Account for the case that some file names can appear _before_ crash report starts.
Start extracting guilty file starting from StartPos.
2018-09-26 12:02:43 +02:00
Alexander Popov
0e7547d77c executor: make the debug output useful for race condition debugging
Sometimes race conditions are reproduced by syz-execprog and are not
reproduced by the programs generated with syz-prog2c. In such cases
it's very helpful to know when exactly the fuzzing syscalls are executed.

Unfortunately, adding timestamps to the output of the original 'debug'
mode doesn't work. This mode provides very verbose output, which slows
down executor and breaks the repro.

So let's make the executor debug output less verbose and add
the timestamps.

Signed-off-by: Alexander Popov <alex.popov@linux.com>
2018-09-24 14:55:35 +02:00
Dmitry Vyukov
684e7e3250 pkg/report: ignore more str* functions 2018-09-24 10:59:44 +02:00
Anton Lindqvist
e029c3e058 pkg/symbolizer: favor portable nm(1) format
On OpenBSD, nm(1) does not support the `-S' option.

The order of symbols from nm(1) varies between platforms, therefore rework the
test case to cope with that.

Fixes #723
2018-09-24 10:12:38 +02:00
Dmitry Vyukov
9a6f6af645 syz-ci: upload coverage reports to GCS
Upload coverage reports from all managers to GCS
after 6 hours of runtime (to make it more apples-to-apples).
2018-09-20 18:29:38 +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
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
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
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
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
Dmitry Vyukov
19e9088bb7 syz-ci: use gmake instead of make on openbsd
Update #712
2018-09-13 12:13:54 +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
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
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
f167cb6b09 executor: sandbox with memory/pid cgroups
Set limit of 32 pids and 200MB per test process.
This should prevent things like fork bombs and frequent OOMs.

Fixes #589
2018-09-10 16:19:47 +02:00
Dmitry Vyukov
b692332724 pkg/report: improve rcu stall/lockup reports
During rcu stalls and cpu lockups kernel loops in some part of code,
usually across several functions. When the stall is detected, traceback
points to a random stack within the looping code. We generally take
the top function in the stack (with few exceptions) as the bug identity.
As the result stalls with the same root would produce multiple reports
in different functions, which is bad.
Instead we identify a representative function deeper in the stack.
For most syscalls it can be the syscall entry function (e.g. SyS_timer_create).
However, for highly discriminated functions syscalls like ioctl/read/write/connect
we take the previous function (e.g. for connect the one that points to exact
protocol, or for ioctl the one that is related to the device).

Fixes #710
2018-09-10 16:19:47 +02:00
Dmitry Vyukov
58f18e3f60 tools/create-gce-image.sh: disable ftrace_dump_on_oops
We don't have anything useful there.
But sometimes fuzzer somehow poppulates it with some nonsense,
and then it all dumped in crashes.
Disable it.
2018-09-10 16:19:40 +02:00
Dmitry Vyukov
6b5120a464 tools/create-gce-image.sh: auto-detect block device type
Currently we choose block device to use (nbd/loop) based on SYZ_VM_TYPE.
Strictly saying these things are orthogonal.
losetup is broken on Ubuntu. qemu-nbd is broken on Debian.
Try to auto-detect what will work based on uname.
2018-09-07 19:04:47 +02:00
Dmitry Vyukov
596466b38c pkg/runtest: fixes for fuchsia
Add simple fuchsia program, the one that is run during image testing.
Fix csource errno printing for fuchsia.
Fix creation of executable files (chmod is not implemented on fuchsia).
Check that we get signal/coverage from all syscalls.
2018-09-06 10:56:09 +02:00
Dmitry Vyukov
196410e4f5 dashboard/config: re-enable selinux
Upstream "selinux: fix mounting of cgroup2 under older policies"
commit fixes mounting of cgroup2 under wheezy selinux policy.
So don't disable selinux on start.
Create separate cmdline arguments that enable selinux and apparmor.
2018-09-05 12:50:53 +02:00
Dmitry Vyukov
59e97f7e17 pkg/report: refine fuchsia function name regexp
C++ function names can contain '~'.
2018-09-04 16:40:27 +02:00
Dmitry Vyukov
98bfd6d34c tools/create-gce-image.sh: add default ext4 options
Set some realistic modern ext4 options when creating the image.
2018-09-03 16:42:59 +02:00
Dmitry Vyukov
a4718693a3 sys/linux: add syz_execute_func
The function executes random code.

Update #310
2018-08-30 21:45:04 -07:00
Dmitry Vyukov
938220fdbb pkg/report: ignore mm/memory.c as guilty file 2018-08-29 21:27:37 -07:00
Dmitry Vyukov
6c7e9d3daa pkg/instance: fix gometalinter warnings 2018-08-29 17:54:51 -07:00
Dmitry Vyukov
a1b245b4dd pkg/instance: fix job testing
New FuzzerCmd generates flags that can't be parsed by an old fuzzer.
Fix that and add a test.
2018-08-29 17:45:13 -07:00
Dmitry Vyukov
edb2f5f1e1 sys/linux: add ext4 ioctls and overlayfs
Update #533
2018-08-29 15:59:16 -07:00
Anton Lindqvist
b771b17ec9 Add mandatory OpenBSD bits (#689)
all: add openbsd support

squash of the following commits:

* openbsd: add mandatory bits
* report: add OpenBSD support
* executor: skip building kvm on OpenBSD
* executor: add OpenBSD support
Linking against libutil is necessary due to usage of openpty(3).
* executor: fix typo in fail() message
* fixup! report: add OpenBSD support
* fixup! openbsd: add mandatory bits
* fixup! openbsd: add mandatory bits
* fixup! openbsd: add mandatory bits
* fixup! report: add OpenBSD support
* gometalinter: skip sys/openbsd
2018-08-28 10:07:26 -07:00
Dmitry Vyukov
36d87ddbf8 pkg/report: refactor and improve fuchsia report parsing
Switch to the existing oops-based infrastructure.
Extending existing code is nearly impossible.

Detect service crashes on fuchsia.

Add more tests.
2018-08-25 18:18:11 -07:00
Dmitry Vyukov
bf3cf0c965 pkg/host: enable coverage on freebsd, disable on netbsd
I messed it up during refactoring.
It's freebsd that has coverage support.
2018-08-25 08:59:51 -07:00
Dmitry Vyukov
20749b5987 pkg/report: ignore android art debug output
Now actually ignore it.
2018-08-25 08:00:22 -07:00
Dmitry Vyukov
dd62265df8 pkg/report: ignore android art debug output 2018-08-25 07:59:35 -07:00
Dmitry Vyukov
95b5c82b28 pkg/build: do not use asan for fuchsia
If we build fuchsia with asan, syz-executor binary fails to run with:

$ /tmp/syz-executor
[00041.656] 01128.01275> dlsvc: could not open 'libc++.so.2'
[00041.656] 06074.06088> Error loading shared library libc++.so.2: ZX_ERR_NOT_FOUND (needed by
[00041.656] 06074.06088> /tmp/syz-executor
[00041.656] 06074.06088> )
[00041.656] 01128.01275> dlsvc: could not open 'libc++abi.so.1'
[00041.656] 06074.06088> Error loading shared library libc++abi.so.1: ZX_ERR_NOT_FOUND (needed by
[00041.656] 06074.06088> /tmp/syz-executor
[00041.656] 06074.06088> )
[00041.663] 01128.01275> dlsvc: could not open 'libunwind.so.1'
[00041.663] 06074.06088> Error loading shared library libunwind.so.1: ZX_ERR_NOT_FOUND (needed by
[00041.663] 06074.06088> /tmp/syz-executor
[00041.663] 06074.06088> )

Disable asan until we figure out how to fix this.
2018-08-20 11:40:44 -07:00
Dmitry Vyukov
4e1e8035f3 pkg/build: update gvisor race build process
Use separate target as this is something that can be upstreamed.
2018-08-18 22:04:17 -07:00
Dmitry Vyukov
7067e78fd6 executor: fix gcc warnings in fuchsia generated code
gcc complains about function declarations not being prototypes,
signed/unsigned cast mismatch and casts between incompatible functions.
Fix them.
2018-08-19 01:53:59 +02:00
Dmitry Vyukov
48613af61c pkg/vcs: use garnet instead of topaz layer for fuchsia
Topaz contains end user applications that are not interesting for us
and only increase build time. The applications also consume lots of memory,
so switching to garnet should leave more memory for the fuzzer
(maybe eliminate some OOMs).
2018-08-18 13:55:01 -07:00
Julia Hansbrough
738da825b2 [fuchsia] Change QEMU args to use multiboot shim. 2018-08-17 07:02:12 -07:00
Dmitry Vyukov
5084a6252d pkg/build: build asan-ified fuchsia
Building with asan is useful to detect any bugs in C/C++ services.
2018-08-14 08:50:56 -07:00
Dmitry Vyukov
565e2ad078 pkg/report: ignore another mutex lock guts function 2018-08-13 17:14:08 -07:00
Dmitry Vyukov
7a88b14122 pkg/compiler: prohibit subargs 2018-08-10 18:50:03 +02:00
Dmitry Vyukov
1fb62d5815 executor: fix FS_XFLAG_IMMUTABLE for 32-bit mode
FS_IOC_FSSETXATTR is not supported in compat mode, use FS_IOC_SETFLAGS instead.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
fa9be14164 pkg/csource: fix 32-bit syscall calls
syscall accepts args as ellipsis, resources are uint64
and take 2 slots without the cast, which is wrong.
Cast resources to long when passing to syscall.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
3a2fe60529 executor: fix cgroups
1. Create per-proc cgroup in executor.
2. Setup cgroups after chdir into test dir
   (it assumes relative paths against test dir).
3. Add test.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
922e8e2734 executor: mount binfmt_mist
We forgot to mount binfmt_misc. Mount it. Add a test.
Increase per-call timeout, otherwise last execve timesout.
Fix csource waiting for call completion at the end of program.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
acf31536e9 executor: clean up immutable dirs
Turns out dirs can be immutable too.

Update #650
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
23b45a7525 executor: remove unnecessary hooks on fuchsia
These are not needed now.
2018-08-09 16:05:46 +02:00
Dokyung Song
2eeda842c8 sys/fuchsia: add syscall description for binding channels to Launcher 2018-08-08 19:31:56 +02:00
Dmitry Vyukov
17a0470620 executor: manually define struct fsxattr
It should be in <linux/fs.h> but is not there on some distros/arches as expected.

Travis build fails with:

      		<stdin>: In function ‘remove_dir’:
        		<stdin>:152:13: error: variable ‘attr’ has initializer but incomplete type
        		<stdin>:152:13: error: excess elements in struct initializer [-Werror]
        		<stdin>:152:13: error: (near initialization for ‘attr’) [-Werror]
        		<stdin>:152:21: error: storage size of ‘attr’ isn’t known
        		<stdin>:153:20: error: ‘FS_IOC_FSSETXATTR’ undeclared (first use in this function)
        		<stdin>:153:20: note: each undeclared identifier is reported only once for each function it appears in
        		<stdin>:152:21: error: unused variable ‘attr’ [-Werror=unused-variable]
        		cc1: all warnings being treated as errors

https://travis-ci.org/google/syzkaller/jobs/413574080
2018-08-08 17:04:50 +02:00
Dmitry Vyukov
d46deef51c executor: clean up immutable files
Fixes #650
2018-08-08 15:06:29 +02:00
Dmitry Vyukov
3653592507 pkg/runtest: assorted improvements
Support checking "blocked"/"unfinished" flags for calls.
Support test constanints, e.g. "requires: threaded" or "requires: -sandbox=setuid".
Some improvements in tools/syz-runtest.

Update #603
2018-08-08 15:05:01 +02:00
Dmitry Vyukov
91e4f273d6 pkg/csource: don't do checkpoint/reset net with setuid sandbox
Missing part of
"executor: don't checkpoint/reset net namespace with setuid sandbox"
2018-08-08 15:02:25 +02:00
Dmitry Vyukov
ddeb9f8d88 executor: don't checkpoint/reset net namespace with setuid sandbox
After setuid the process won't have rights to reset net namespace,
but it should not be able to change it during fuzzing too.
So just skip that part.
2018-08-08 11:16:54 +02:00
Dan Austin
14f8a76fe7 executor: checkpoint net namespace in the right namespace
With checkpoint_net_namespace moved to setup_common,
and Android fuzzing session terminates prematurely due to
ipv4_tables not being initialized at this time.
Moving the call back to loop fixes this behavior.
2018-08-08 11:03:33 +02:00
Dmitry Vyukov
1beb81367c executor: check write return value
gcc complains:

error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]

Also fix includes.
2018-08-05 13:05:47 +02:00
Dmitry Vyukov
3a7200e49b executor: abort fuse connection
If the test process is not dying after 100ms,
abort all fuse connections in the system.
This gets rid at least of simple fuse deadlocks,
let's see how well this works in all cases.
2018-08-04 17:50:58 +02:00
Dmitry Vyukov
bf45aa5363 pkg/report: skip more spinlock frames
Currently this report is named:
"general protection fault in perf_trace_lock"
which is bad.
2018-08-04 17:39:21 +02:00
Dmitry Vyukov
3476a2dfb9 pkg/osutil: replace UmountAll with RemoveAll
In pkg/ipc we don't just want to UmountAll,
we want to remove all handling as many cases as possible
(mounts, read-only files, etc, similar to executor's remove_dir).
So unmounting and removing needs to be a single function,
so that it can handle all these cases.
2018-08-04 15:50:40 +02:00
Dmitry Vyukov
df7f6947ba pkg/runtest: skip 32-bit tests in short mode
Fails on travis...
2018-08-03 21:24:35 +02:00
Dmitry Vyukov
2763e04c22 tools/syz-runtest: add tool for program unit testing
The tool is run as:

$ syz-runtest -config manager.config

This runs all programs from sys/*/test/* in different modes
on actual VMs and checks results.

Fixes #603
2018-08-03 21:08:02 +02:00
Dmitry Vyukov
78e3ad98f6 sys/test: add more tests
Add syz_errno syscall which sets errno to the argument,
and add a test with different errno values.
This mostly tests the testing infrastructure itself.

Add syz_compare syscall which compare two blobs,
this can be used for testing of argument memory layout.

Implement syz_mmap and fix Makefile to allow building syz-execprog for test OS.
Useful for debugging.

Update #603
2018-08-03 19:53:14 +02:00
Dmitry Vyukov
5ba57bfe16 pkg/runtest: add package for syzkaller program unit-testing
Package runtest is a driver for end-to-end testing of syzkaller programs.
It tests program execution via both executor and csource,
with different sandboxes and execution modes (threaded, repeated, etc).
It can run test OS programs locally via run_test.go
and all other real OS programs via tools/syz-runtest
which uses manager config to wind up VMs.
Test programs are located in sys/*/test/* files.

Update #603
2018-08-03 18:47:42 +02:00
Dmitry Vyukov
649477b6a5 pkg/ipc: remove abort signal and buffer size
They were needed for intermediate gvisor support.
Now that we have end-to-end support for gvisor,
they are not needed anymore. Remove.
2018-08-03 18:29:20 +02:00
Dmitry Vyukov
6bfd4f09db pkg/ipc: move flags into subpackage
Move all ipc flags into pkg/ipc/ipcconfig package
so that importing pkg/ipc does pull in the flags.
2018-08-03 18:12:24 +02:00
Dmitry Vyukov
5ff1f9faec pkg/csource: minor fixes
1. Print errno with %u instead of %d
2. Avoid unused var warning for syz_emit_ethernet
   when tracing is enabled.
2018-08-03 16:57:08 +02:00
Dmitry Vyukov
534859fe5a pkg/osutil: minor tweaks
1. Make it clear when a command times out.
2. Don't add trailing newline for VerboseError if output is empty.
3. Fix WriteExecFile for the case when the file already exists.
2018-08-03 16:51:48 +02:00
Dmitry Vyukov
0a2c27237b pkg/rpctype: ignore SetDeadline error
SetDeadline is not implemented on fuchsia and always fails.
2018-08-03 12:22:36 +02:00
Dmitry Vyukov
41beddb6da executor: extend logging in netfilter code
We see some failures there, extend logging so that it's least
possible to understand what exactly call has failed.
2018-08-02 19:45:31 +02:00
Dmitry Vyukov
5cbdd9f444 gometalinter: strengthen gocyclo limit
Strengthen gocycle limit 35->24! Yay! No more jumbo functions!

Fixes #538
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
394e6910d0 pkg/compiler: refactor checkType
checkType is too long and complex.
Move basic type checks and args checks into separate functions.

Update #538
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
1baf121c2f pkg/csource: refactor generateCalls
Move call generation into a separate function.

Update #538
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
3c5c9177b5 pkg/csource: refactor defineList
Make it simpler and shorter.

Update #538
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
fbedd425b5 pkg/mgrconfig: move from syz-manager/mgrconfig
mgrconfig was used only by syz-manager initially,
but now it's used by a dozen of packages and it's
weird to import from under a binary dir.
pkg/ is much more reasonable dir for a widely used
helper package.
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
72ad4a3c4c pkg/report: refactor test
Split a long function.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
1637002cde pkg/ipc: refactor output parsing
readOutCoverage was complete mess.
Split it into several functions.
Use callReply struct directly.
Make error handling more idiomatic.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
bdc8436c58 pkg/serializer: refactor
Factor out serialization of pointers, slices and
structs into separate functions.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
af15ef43a8 pkg/compiler: refactor checkNames
Too complex. Split into 2 functions.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
3a4641d90c pkg/compiler: refactor structGen
Still too complex. Split more.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
c67a9331a4 gometalinter: clean up some errcheck warnings
Check some errors where relevant.
Unfortunately enabling errcheck does not look feasible, too many warnings.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
1477993e1b pkg/compiler: work around vet crash
vetshadow not works, so enable it.

Update https://github.com/golang/go/issues/26725
Update #538
2018-07-31 20:47:36 +02:00
Dmitry Vyukov
8ef497b652 gometalinter: clean up vetshadow
This just cleans up existing warnings.
vetshadow is not enabled yet because it crashes.

Update #538
2018-07-31 20:38:33 +02:00
Dmitry Vyukov
efc2683657 pkg/csource: rafactor option checking
Update #538
2018-07-31 18:43:45 +02:00
Dmitry Vyukov
46bad78542 pkg/report: refactor linux report parsing
Split a very long function into 2.

Update #538
2018-07-31 18:38:54 +02:00