Commit Graph

261 Commits

Author SHA1 Message Date
Zach Riggle
0a7cf4ec63 manager: Fix default value for 'sandbox' (#666)
docs: fix default sandbox value

The docs and code comments state in several places that 'setuid'
is the default sandbox value.  However, the default is actually
'none'.  Fix docs.
2018-08-01 19:42:07 +02:00
Dmitry Vyukov
ba6c552acd syz-manager: refactor vmLoop
Slightly reduce cyclomatic complexity.

Update #538
2018-07-31 18:43:50 +02:00
Julia Hansbrough
a922a2e809 [manager] Fix typo.
s/cash/crash/
2018-07-25 08:28:36 +02:00
Jiangen Jiao
f69c5fcd76 syz-manager: Support kernelSrc and vmlinux from different tree
If vmlinux built from different tree from kernelSrc, cover page will failed to
show. So match only the path without prefix.
2018-07-23 09:52:04 +02:00
Dmitry Vyukov
93213ec0d3 syz-manager/mgrconfig: default kernel_src to kernel_obj
... which in turn defaults to vmlinux.
This makes it possible to only specify vmlinux or only kernel_obj.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
ef387e080a syz-manager: don't print loop state on info requests
Printing loop state on info requests (e.g. due to http requests)
is somewhat confusing as no state change actually happens.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
04bd6c3d9e pkg/instance: pass -os to execprog/fuzzer only for akaros
Only akaros needs OS, because the rest assume host OS.
But speciying OS for all OSes breaks patch testing on syzbot
because old execprog does not have os flag.
2018-07-06 14:43:24 +02:00
Dmitry Vyukov
538df42ec7 pkg/repro: provide stats even for failed repro
Provide stats and logs for failed repro and save it in manager.
In particular log is useful for failed repros,
currently there is no visibility into why bugs
failed to reproduce.
2018-07-05 13:14:00 +02:00
Dmitry Vyukov
cf4583c661 syz-manager: pass OS to fuzzer
Needed for akaros.
2018-07-05 10:44:34 +02:00
Dmitry Vyukov
f7498af7af prog: add stronger fallback signal
Also mixin resource constructors and some signature
of flags values for successful calls into fallback coverage.
2018-06-29 20:34:43 +02:00
Dmitry Vyukov
0a971ab1d0 syz-manager: implement fallback coverage report 2018-06-29 18:15:41 +02:00
Dmitry Vyukov
68ce63c468 pkg/build: support fuchsia builds 2018-06-28 13:42:07 +02:00
Dmitry Vyukov
e502f1a6df docs: remove mentions of vmlinux
vmlinux is deprecated in favor of kernel_obj.
Remove all mentions of it.
Also warn in syz-manager/mgrconfig if vmlinux is set.
2018-06-28 13:42:04 +02:00
Dmitry Vyukov
4dd045dff9 syz-manager: remove unused field 2018-06-26 19:02:01 +02:00
Dmitry Vyukov
e726bdf922 syz-manager: make rpc communication finer grained
RPC package does excessive caching per connection,
so if a larger object is ever sent in any direction,
rpc connection consumes large amount of memory persistently.
This makes manager consume gigs of memory with large
number of VMs and larger corpus/coverage.

Make all communication done in very limited batches.
2018-06-26 13:59:47 +02:00
Dmitry Vyukov
2a075d57ab pkg/report: allow to specify suppressions per OS
Currently all (linux-specific) suppressions are hardcoded in mgrconfig.
This is very wrong. Move them to pkg/report and allow to specify per OS.
Add gvisor-specific suppressions.
This required a bit of refactoring. Introduce mgrconfig.KernelObj finally.
Make report.NewReporter and vm.Create accept mgrconfig directly
instead of passing it as multiple scattered args.
Remove tools/syz-parse and it always did the same as tools/syz-symbolize.
Simplify global vars in syz-manager/cover.go.
Create reporter eagerly in manager. Use sort.Slice more.
Overall -90 lines removed.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
c31f96a8c6 executor: rework fallback coverage
We have fallback coverage implmentation for freebsd.
1. It's broken after some recent changes.
2. We need it for fuchsia, windows, akaros, linux too.
3. It's painful to work with C code.

Move fallback coverage to ipc package,
fix it and provide for all OSes.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
9a7d0a5412 pkg/report: pass vm type to NewReporter
For the case when VM type affects output.
Will be needed for gvisor. It is kinda linux, but kinda not.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
87bfb99cfe vm: pass instance to MonitorExecution
It may need it later to try to obtain additional
diagnostic from hanged instances.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
45c54f755c syz-manager: fix race during reporter init 2018-06-18 19:50:50 +02:00
Dmitry Vyukov
ee54fec6da syz-manager: ignore inputs that are not enabled on target
Currently we only ignore programs that contain syscalls
that are not statically enabled in config. This does not
account for syscalls that are not supported on target
machine. Load corpus after we got machine check with
actual list of supported syscalls.
2018-06-18 19:45:52 +02:00
Dmitry Vyukov
6fb8a0255e syz-manager: don't save repros sent to dashboard
These repros eat unbounded amount of disk space.
2018-06-12 18:31:28 +02:00
Dmitry Vyukov
06ece2ca66 pkg/host: rework host feature detection/setup
Currently host feature detection/setup code is spread
across platform-independent fuzzer code, pkg/host, pkg/ipc
and executor.
Move this all into pkg/host and show readable info
about features on manager start.

Fixes #46
2018-06-12 14:53:22 +02:00
Dmitry Vyukov
ae8bdb5058 syz-fuzzer: don't crash on commit mismatch
We now check for manager-fuzzer-executor commit mismatch (see Manager.Check).
But in some cases commit mismatch is not detected gracefully, and instead
leads to panics in fuzzer. Namely, when -enabled_syscalls fuzzer flag includes
large syscalls numbers, so large that they are no present at all in the an old
revision that fuzzer uses, in such case fuzzer panics.

Notify manager about invalid calls instead.

Fixes #464
2018-06-11 12:12:01 +03:00
Dmitry Vyukov
0c5447b340 syz-manager/mgrconfig: default to sandbox=none
sandbox=none is the default for execprog.
And now it's working reliably.
And only none makes sense for anything but linux.
2018-06-06 16:15:28 +02:00
Dmitry Vyukov
6479ab2a75 Makefile, sys/targets: move all native compilation logic to sys/targets
We currently have native cross-compilation logic duplicated
in Makefile and in sys/targets. Some pieces are missed in one
place, some are in another. Only pkg/csource knows how to check
for -static support.

Move all CC/CFLAGS logic to sys/targets and pull results in Makefile.

This should make Makefile work on distros that have broken x86_64-linux-gnu-gcc,
now we will use just gcc. And this removes the need to define NOSTATIC,
as it's always auto-detected.

This also paves the way for making pkg/csource work on OSes other than Linux.
2018-06-06 10:02:03 +02:00
Dmitry Vyukov
477728038c syz-ci: fix manager config creation
SyzFuzzerBin/SyzExecprogBin/SyzExecutorBin are ended up being empty.
Fix this.
2018-05-14 12:17:34 +02:00
Dmitry Vyukov
4fce9bf152 syz-manager: add concept of partial configs
syz-ci uses partial (incomplete) manager config in several places.
Currently it is implemented in some ugly way.
Provide better support and unexport DefaultValues and SplitTarget.

Update #501
2018-05-14 11:16:57 +02:00
Dmitry Vyukov
9e0846e8a4 all: get rid of underscores in identifiers
Underscores are against Go coding style.

Update #538
2018-05-07 17:59:06 +02:00
Dmitry Vyukov
78b251cbd7 all: fix too long lines
Not sure why I have not seen warnings about
these lines on another machine...
2018-05-05 16:00:01 +02:00
Dmitry Vyukov
9fe5658a1b gometalinter: check dot imports
Update #538
2018-05-03 14:41:34 +02:00
Dmitry Vyukov
1e49a807a4 syz-manager: log suppressed crashes always
If there are few of them, it does not matter if they are printed or not.
However if there are lots of them, they need to be seen in log.
2018-04-27 15:43:55 +02:00
Dmitry Vyukov
476b8ca987 syz-manager: properly calculate previous instruction PC
We used to subtract 5 which is length of call instruction on amd64.
Do proper per-arch calculation.
2018-04-27 14:33:01 +02:00
Dmitry Vyukov
9b895661a9 syz-manager: fix coverage report for archs other than amd64 2018-04-20 20:14:10 +02:00
Dmitry Vyukov
eae05cb05e syz-manager: make misconfig errors more comprehensible 2018-04-19 20:16:21 +02:00
Dmitry Vyukov
074c0dd9b9 syz-manager: make error about "no syscalls enabled" more useful
Exit only after we print why syscalls were disabled.
2018-04-19 20:13:50 +02:00
Dmitry Vyukov
bcc3786b30 syz-manager: make error messages about inconsistent binaries more comprehensible 2018-04-19 20:12:03 +02:00
Dmitry Vyukov
a6714e43a9 syz-manager: make error about changed files more comprehensible 2018-04-19 20:01:42 +02:00
Dmitry Vyukov
66f22a7fdc syz-manager: don't abort on disabled syscalls
It turns out to be too difficult to specify a precise set
of syscalls when, say, all setsockopt's for some sockets
need to be enabled, but not enabled for other sockets.
Just warn user about disabled syscalls, but don't abort.
2018-04-07 14:02:03 +02:00
Dmitry Vyukov
cd44cce1df syz-manager/mgrconfig: restore old enable/disable_syscalls behavior
The previous change in behavior break a bunch of existing configs
("bpf" does not match anything). Restore old behavior.
To get only write syscall, one can do:
enable_syscalls: "write",
disable_syscalls: "write$*"
2018-04-07 13:48:55 +02:00
Dmitry Vyukov
53196ce262 syz-manager: warn about disabled syscalls in enable_syscalls
syz-manager used to silently transitively disable syscalls
for which input resources can't be created.
This caused lots of confusion, or worse, users did not notice
that syzkaller does not actually test what they want.
Fail loudly with a readable explanation when a syscall
explicitly enabled in enable_syscalls is actually disabled.

Note: this requires to slightly change enable/disable_syscalls
matching logic. Previously "foo" would match "foo" and all "foo$BAR",
now it matches only "foo". But "foo*" can be used to match all
disciminations.
2018-04-06 21:08:54 +02:00
Dmitry Vyukov
48a846e42b syz-manager/mgrconfig: check that ssh key is properly protected 2018-04-06 17:49:50 +02:00
Dmitry Vyukov
0d845719c3 syz-manager: move syscall info to a separate page
It's rarely needed. So move from main page.
2018-04-02 20:09:30 +02:00
Dmitry Vyukov
188daeb272 syz-manager: show what crashes are currently being reproduced 2018-04-02 20:09:26 +02:00
Dmitry Vyukov
185ac3525e prog: support big-endian during hints matching
Use big-endian match/replace for both blobs and ints.
Sometimes we have unmarked blobs (no little/big-endian info);
for ANYBLOBs we intentionally lose all marking;
but even for marked ints we may need this too.
Consider that kernel code does not convert the data
(i.e. not ntohs(pkt->proto) == ETH_P_BATMAN),
but instead converts the constant (i.e. pkt->proto == htons(ETH_P_BATMAN)).
In such case we will see dynamic operand that does not
match what we have in the program.
2018-04-01 15:28:01 +02:00
Dmitry Vyukov
63f4cf6fff syz-manager: log when a crash report is corrupted 2018-03-31 17:27:58 +02:00
Dmitry Vyukov
fef07bd04c syz-manager: add special type=none
Type "none" is a special case for debugging/development when manager
does not start any VMs, but instead you start them manually
and start syz-fuzzer there.
2018-03-31 16:25:15 +02:00
Dmitry Vyukov
36d1c4540a all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
2018-03-08 18:48:26 +01:00
Dmitry Vyukov
87044370b8 syz-manager: ask reproducers from hub only if connected to dashboard
All reproducers from hub produce too much load on local managers.
2018-02-22 20:21:07 +01:00
Dmitry Vyukov
04cbdbd1ae syz-fuzzer: prioritize signal from successful syscalls
Signal on successful syscalls is more valuable than
signal on unsuccessful syscalls.y
2018-02-20 20:51:41 +01:00