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
ba6c552acd
syz-manager: refactor vmLoop
...
Slightly reduce cyclomatic complexity.
Update #538
2018-07-31 18:43:50 +02:00
Dmitry Vyukov
97bce4e2ce
prog: refactor program serialization
...
Make argument serialization Arg method.
This eliminates a very long function
that serializes all arguments.
Update #538
2018-07-31 18:43:50 +02:00
Dmitry Vyukov
91154fa55c
dashboard/app: refactor config checking
...
Split a very long function into several smaller functions.
Update #538
2018-07-31 18:43:50 +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
Dmitry Vyukov
46b824df22
prog: refactor SerializeForExec
...
Reduce cyclomatic complexity.
Update #538
2018-07-31 18:38:54 +02:00
Dmitry Vyukov
8d7727990b
pkg/csource: refactor call generation
...
Slightly reduce cyclomatic complexity.
Update #538
2018-07-31 17:05:09 +02:00
Dmitry Vyukov
69eaab186d
pkg/compiler: refactor genStructDescs
...
Reduce cyclomatic complexity of genStructDescs.
Update #538
2018-07-31 17:04:29 +02:00
Dmitry Vyukov
0e9b376bc3
prog: refactor Minimize
...
Reduce cyclomatic complexity of argument minimization
by moving type-specific logic into separate functions.
Fix few bugs along the way.
Update #538
2018-07-31 16:06:21 +02:00
Dmitry Vyukov
531d157044
tools/syz-execprog: refactor
...
Reduce cyclomatic complexity of the main function.
It's too huge.
Update #538
2018-07-31 16:05:03 +02:00
Dmitry Vyukov
50c3709eb0
.gometalinter: reduce dupl threshold
...
Reduce dupl threshold from 63 to 60 and fix violations.
Update #538
2018-07-31 12:42:52 +02:00
Dmitry Vyukov
31549f438f
README.md: add go report card and license icons
2018-07-31 12:22:54 +02:00
Dmitry Vyukov
f5d67fbd9c
.gometalinter.json: enable gofmt
...
The part that we want from gofmt is simplify (-s).
Fix all code that needs fixing.
Update #538
2018-07-31 12:16:54 +02:00
Dmitry Vyukov
b8bd991ee2
executor: make current_time_ms/sleep_ms
...
Fix conditions for when current_time_ms/sleep_ms are used
and make them static.
2018-07-30 11:17:44 +02:00
Dmitry Vyukov
1a381291a3
executor: collect coverage from unfinished syscalls
...
Write coverage from unfinished syscalls.
Also detect when a syscall was blocked during execution,
even if it finished. Helpful for fallback coverage.
Fixes #580
2018-07-29 19:46:05 +02:00
Dmitry Vyukov
0824d7a1bf
vm/gce: fix build
...
fail
2018-07-29 10:16:20 +02:00
Dmitry Vyukov
419000cc0a
vm: fix "kill fuzzer on first kernel bug"
...
The problem with that commit is that for GCE implementation
we immidiately kill console connection too when receive diagnose signal.
This leads to truncated output.
2018-07-29 10:07:30 +02:00
Dmitry Vyukov
ebf656d79b
syz-fuzzer: generate programs more frequently if no coverage
...
Generating every other time should be good,
because fallback signal is really weak.
2018-07-27 21:13:10 +02:00
Dmitry Vyukov
3abee99f46
dashboard/app: fix crash selection for reporting
...
See the issue for the problem description.
Include repro level into reporting priority,
so that we can order by just it during selection
and ignore ReproC/ReproSyz.
Fixes #634
2018-07-27 21:10:01 +02:00
Dmitry Vyukov
a43c5ed638
pkg/csource: turn off 32-bit tests
...
Test OS fails the same was as linux on travis.
2018-07-27 13:48:44 +02:00
Dmitry Vyukov
9faf980ad5
executor: disable clang-format for some parts
...
clang-format badly mishandles this part,
moreover different versions mishandle it differently.
2018-07-27 13:48:44 +02:00
Dmitry Vyukov
ca3f673ab4
.travis.yml: use clang-format 6.0.1
2018-07-27 13:48:44 +02:00
Dmitry Vyukov
788351b1b0
pkg/csource: rewrite gen.sh in Go
...
Shell files cause portability problems.
On Linux it's hard to install /bin/sh,
/bin/bash is not present on *BSD.
Any solution is hard to test on Darwin.
Don't even want to mention Windows.
Just do it in Go.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
b25fc7b831
pkg/csource: add option to trace syscall results
...
This will be needed for testing of generated programs.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
9d92841b4e
pkg/csource: tidy generated code
...
1. Remove unnecessary includes.
2. Remove thunk function in threaded mode.
3. Inline syscalls into main for the simplest case.
4. Define main in common.h rather than form with printfs.
5. Fix generation for repeat mode
(we had 2 infinite loops: in main and in loop).
6. Remove unused functions (setup/reset_loop, setup/reset_test,
sandbox_namespace, etc).
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
c3da5dc5e0
executor: simplify event_timedwait
...
We always have current_time_ms in event_timedwait
so use it instead of manual clock_gettime calls
which tend to be bulkier.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
4dcfea28eb
pkg/host: support test OS
...
test OS parasitizeson other OSes just as akaros,
and there is nothing to detect as well.
So use the same stub for test as for akaros.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
22105302cc
executor: ignore unshare errors in setuid sandbox
...
We already do this in sandbox=none, but forgot about setuid.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
c7725f52b1
syz-execprog: initialize net devices
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
68faa52582
prog: parse comments in serialized programs
...
Remember per-call comments, will be useful for annotating tests.
Also support this form:
call() # comment
2018-07-27 10:22:23 +02:00
Zach Riggle
0889ba7a79
adb: Add console logic for ttyUSB.serial
...
By using UDEV rules, we can create device nodes which exist at
/dev/ttyUSB.{android device serial}
Which makes it easier to determine which console belongs to a device.
While this is non-standard behavior, it's an inexpensive path check
and makes the lookup faster and deterministic.
2018-07-26 20:13:37 +02:00
Dmitry Vyukov
ad155aa428
pkg/csource: say what compiler is missing
2018-07-25 10:44:45 +02:00
Dmitry Vyukov
e0c1bcbabc
prog: move MaxPids const to prog
...
The const may be needed by other packages.
E.g. when checking manager config.
2018-07-25 10:39:29 +02:00
Dmitry Vyukov
3cbc0ac516
pkg/csource: tun/cgroups are linux-specific
2018-07-25 10:39:29 +02:00
Dmitry Vyukov
5164d966fd
executor: remove unused file
...
Leftover after "executor: overhaul".
2018-07-25 10:39:29 +02:00
Dmitry Vyukov
1ca246b8b2
Makefile: fix build
2018-07-25 08:39:05 +02:00
Dmitry Vyukov
da1670a69d
Makefile: install /bin/sh
...
Installs /bin/sh required for pkg/csource/gen.sh
2018-07-25 08:36:42 +02:00
Anton Lindqvist
9182049979
pkg/csource: remove /bin/bash assumption
...
OpenBSD and probably other BSDs does not ship with /bin/bash. This particular
script runs fine with regular /bin/sh.
2018-07-25 08:30:07 +02:00
Julia Hansbrough
a922a2e809
[manager] Fix typo.
...
s/cash/crash/
2018-07-25 08:28:36 +02:00
Dokyung Song
6982d892b6
sys/targets: fix Fuchsia lib directory
...
to fix linking error when building syz-executor for Fuchsia.
2018-07-25 08:26:57 +02:00
Dmitry Vyukov
375a3e31e1
pkg/build: save kernel config early
...
Currently we don't capture kernel config for broken builds
because the config is saved as the last step.
Save it as early as possible.
2018-07-24 14:30:05 +02:00
Dmitry Vyukov
9b6bfa3fe8
dashboard/app: don't show broken links to empty configs
2018-07-24 14:29:21 +02:00
Dmitry Vyukov
daf70d7973
dashboard/config: disable CONFIG_DRM_AMDGP
...
Causes build failures:
https://syzkaller.appspot.com/bug?extid=9118f0a7ae77f4eee4a9
and we don't test it anyway.
While we are here disable other GPUs
and update config to latest version.
2018-07-24 14:28:01 +02:00
Dmitry Vyukov
d1ed573636
Makefile: disable 32-bit executor build
...
Fails on travis...
2018-07-24 14:04:43 +02:00
Dmitry Vyukov
beb957b793
vm/qemu, vm/gce: kill fuzzer on first kernel bug
...
Some kernel bugs don't stop kernel.
For such bugs whiel vm.MonitorExecution waits for kernel output for 10 secs,
fuzzer continues running programs and produces tons of output
after the kernel bug message. Kill fuzzer once MonitorExecution
detects a kernel bug.
2018-07-24 13:44:48 +02:00
Dmitry Vyukov
4969639c7c
executor: fix strict aliasing violations
...
test_copyin does bad things. Fix that.
executor/test.h: In function ‘int test_copyin()’:
executor/common.h:299:16: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
*(type*)(addr) = (type)(val); \
^
2018-07-24 13:29:26 +02:00
Dmitry Vyukov
9fe4bdc5f1
executor: overhaul
...
Make as much code as possible shared between all OSes.
In particular main is now common across all OSes.
Make more code shared between executor and csource
(in particular, loop function and threaded execution logic).
Also make loop and threaded logic shared across all OSes.
Make more posix/unix code shared across OSes
(e.g. signal handling, pthread creation, etc).
Plus other changes along similar lines.
Also support test OS in executor (based on portable posix)
and add 4 arches that cover all execution modes
(fork server/no fork server, shmem/no shmem).
This change paves way for testing of executor code
and allows to preserve consistency across OSes and executor/csource.
2018-07-24 12:04:27 +02:00
Dmitry Vyukov
db7957bc09
pkg/report: add format for akaros warnings
2018-07-24 10:10:45 +02:00
Dmitry Vyukov
a0512a53a3
vm/qemu: use e1000 instead of e1000e
...
e1000e fails on recent Debian distros with:
Initialization of device e1000e failed: failed to find romfile "efi-e1000e.rom
2018-07-23 20:28:18 +02:00