113 Commits

Author SHA1 Message Date
Dmitry Vyukov
8f58526cb8 all: add fault injection capability
Systematically inject faults during smashing.
Requires kernel patch:
"fault-inject: support systematic fault injection"
(currently in linux-next).
2017-05-26 17:22:57 +02:00
Dmitry Vyukov
e33075c047 syz-manager: reformat 2017-05-25 11:36:19 +02:00
baishuai
6e254bdd13 manager: save and reuse allSymbols, vmOffset 2017-05-25 17:30:27 +08:00
Dmitry Vyukov
7e458d6416 syz-hub: send new inputs in smaller parts
Currently hub sends all inputs on first manager connect.
This can be 100K+ inputs and can take long time
and consume tons of memory. Send inputs in 1K parts.

Also increase rpc timeouts as hub still has global mutex.
2017-05-23 16:33:28 +02:00
baishuai
85a6d58149 manager: do not print "executed programs" until first connection from test machine.
add my name to contributors
2017-05-21 12:48:25 +08:00
Andrey Konovalov
91ea49ce25 vm: add Odroid support
This commit adds Odroid C2 support to syzkaller.
It's now possible to specify "type": "odroid" in manager config.

Documentation on how to setup fuzzing with Odroid C2 board is here:
https://github.com/google/syzkaller/wiki/Setup:-Odroid-C2

Note, that after this change libusb-1.0-0-dev package should be
installed to build syzkaller.
2017-03-10 17:10:52 +01:00
Dmitry Vyukov
1466d0cb9f manager: add ability to communicate with dashboard
Manager can send crashes and repros to a dashboard app.
Dashboard app is not checked-in yet.
2017-02-17 18:52:07 +01:00
Dmitry Vyukov
525be5b8a7 manager: don't recalculate dynamic priorities too often
Recalculating dynamic priorities requires deserializing all programs,
and that is slow. So do it at most once per 30 mins and don't hold
the mutex during prio calculation.
2017-01-30 15:44:12 +01:00
Dmitry Vyukov
22361c62e9 manager: collect crash info without holding the global mutex
Crash collection just reads files, so the mutex is unnecessary.
2017-01-30 15:23:29 +01:00
Dmitry Vyukov
1f0546f0da manager, fuzzer, hub: move common rpc code into rpctype
If hub hangs, it causes all managers to hang as well as they call
hub under the global mutex. So move common rpc code into rpctype
and make it more careful about timeouts (tcp keepalives, call timeouts).
Also don't call hub under the mutex, the call can be slow.
2017-01-30 15:15:37 +01:00
Dmitry Vyukov
e00c6a347b syz-manager: print at most 10 deleted programs
Printing thousands of programs is slow and unnecessary.
2017-01-28 17:52:14 +01:00
Dmitry Vyukov
24362e5bc7 manager: make disabledHashes map 2017-01-27 21:48:36 +01:00
Dmitry Vyukov
8365c3838d all: implement edge coverage
Currently syzkaller uses per-call basic block (BB) coverage.
This change implements edge (not-per-call) coverage.
Edge coverage is more detailed than BB coverage as it captures
not-taken branches, looping, etc. So it provides better feedback signal.
This coverage is now called "signal" throughout the code.
BB code coverage is also collected as it is required for visualisation.
Not doing per-call coverage reduces corpus ~6-7x (from ~35K to ~5K),
this has profound effect on fuzzing efficiency.
2017-01-27 20:46:18 +01:00
Dmitry Vyukov
652ac3731d syz-manager: add benchmarking mode
In benchmarking mode (if the new -bench flag is specified)
syz-manager writes execution statistics into the specified file.
This allows later comparison of different runs (baseline vs some experiment).
For example, verify that some fuzzing modification indeed leads to larger coverage.
2017-01-20 14:56:20 +01:00
Dmitry Vyukov
f9869965cf syz-manager: don't create legacy corpus dir if it does not exist 2017-01-20 14:56:20 +01:00
Dmitry Vyukov
823604de7e syz-manager: track fuzzing time
Fuzzing time is amount of time we spent actually fuzzing.
It excludes VM creation time, crash reproducing time, etc.
On the other hand it is multipled by number of currently
fuzzing VMs, so it can be larger than uptime time.
2017-01-20 14:56:20 +01:00
Dmitry Vyukov
c4f622fcb3 syz-manager: add option to turn off crash reproducing
Reproducing is still turned on by default,
turning it off can be useful for benchmarking.
2017-01-20 14:56:20 +01:00
Dmitry Vyukov
ffe327412b syz-fuzzer: don't reminimize all programs from corpus on start
Minimization takes considerable time on start, but the programs were already minimized.
There are some chances that we could minimize it better this time,
but still it does not worth very slow start (which is especially painful for development).
2017-01-18 19:58:12 +01:00
Dmitry Vyukov
0e2608c229 syz-manager: speed up coverage report
Uncovered PCs were handled very badly:
we added PCs from the same function multiple times
and did not remove covered PCs. As the result total
number of uncovered PCs was terrific.
Fix that.
2017-01-17 17:14:11 +01:00
Dmitry Vyukov
f6c7b90523 syz-manager: speed up crash reading
Currently we read lots of unnecessary files. This is slow on GCE.
Read only necessary info.
For summary report use on readdirnames (which does not do stat on every file).
For detailed crash report read additional info, but only for this crash.
2017-01-16 21:39:34 +01:00
Dmitry Vyukov
c91904333f db: add package
Package db implements a simple key-value database.
The database is cached in memory and mirrored on disk.
It is used to store corpus in syz-manager and syz-hub.
The database strives to minimize number of disk accesses
as they can be slow in virtualized environments (GCE).

Use db in syz-manager instead of the old PersistentSet.
2017-01-16 20:42:52 +01:00
Dmitry Vyukov
43d5c364a2 syz-manager: move include files to the bottom of coverage report
They are usually less interesting than source files.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
ec9744f3e5 syz-manager, syz-gce: output 20 log lines instead of 50 in web UI
50 lines take too much space, there is scroll bar if necessary.
2017-01-09 20:19:44 +01:00
Dmitry Vyukov
80b6c954f8 manager: add ability to ignore bugs
Add new config parameter "ignores" which contains list of regexp expressions.
If one of the expressions is matched against oops line,
crash report is not saved and VM is not restarted.
2016-12-19 17:39:03 +01:00
Dmitry Vyukov
a59452c4b2 vm/gce: handle graceful preemption
In case of graceful preemption fuzzer should be terminated by SIGTERM.
Catch it and propagate to manager.
2016-12-16 16:11:18 +01:00
Dmitry Vyukov
73b7be0e9c manager: print how long VMs running before restarting
For a potential case VM unexpectedly exits too early.
2016-12-08 17:28:42 +01:00
Dmitry Vyukov
ad8354e9bd manager: fix potential nil deref crash
res.res.CRepro crashes if res.res == nil.
Fix that.
2016-12-06 20:08:04 +01:00
Dmitry Vyukov
eac6d72f0e manager: use only 1 proc in debug mode
Parallel procs produce lots of intermixed output.
2016-11-29 15:17:48 +01:00
Dmitry Vyukov
9604794dce manager: reproduce crashes on the fly
With this change manager will run reproduction on crashes
until reproducer is discovered, but at most 3 times.

If reproducer is discovered it is saved with crashes and shown on the web UI.
2016-11-25 11:07:52 +01:00
Andrey Konovalov
5f1dc34693 manager: add empty line before per-call coverage in html 2016-11-22 16:06:49 +01:00
Andrey Konovalov
7c5f5c84aa manager: print actual number of loaded progs 2016-11-22 16:06:49 +01:00
Dmitry Vyukov
c9ae0f69d8 vm: add ability to interrupt commands
This is required for crash reproduction in manager.
2016-11-19 11:14:11 +01:00
Dmitry Vyukov
dbc7ff3805 manager: unbreak build 2016-11-18 19:18:09 +01:00
Dmitry Vyukov
e8de4be407 manager: enable keepalives on rcp connections
VMs die frequently and it causes orphan tcp rpc connections on manager.
2016-11-18 19:06:04 +01:00
Dmitry Vyukov
cd74cc9cf4 syz-hub: add program
syz-hub is used to exchange programs between syz-managers.
2016-11-17 18:38:10 +01:00
Dmitry Vyukov
128816142c syz-gce,syz-manager: add name config parameter
Name is used for identification on web ui
and included in gce instance names (so that
several managers can coexist in a single project).
2016-11-16 13:19:33 +01:00
Dmitry Vyukov
f5a15094af syz-gce, syz-manager: save image tag in syz-gce, show in syz-manager 2016-10-10 17:32:27 +02:00
Dmitry Vyukov
ef3ee4ad56 manager: minor tweaks to web ui 2016-10-10 13:11:31 +02:00
Dmitry Vyukov
6796d65400 syz-manager, syz-gce: show latest log messages in log textarea 2016-10-10 13:00:27 +02:00
Dmitry Vyukov
1af94b8f0c manager: show cached log in web ui 2016-10-09 11:45:39 +02:00
Dmitry Vyukov
222090e3b4 log: add package
Log is a simple wrapper around std log package.
It is meant to solve 2 main problems:
1. Logging from non-main packages (mainly, vm/* packages).
   Currently they can either always log or not log at all.
   But they can't respect program verbosity setting.
   Log package allows all packages to use the same verbosity setting.
2. Exposing recent logs in html UI.
   Namely we want to tee logs to console and html UI.
2016-10-09 11:27:48 +02:00
Dmitry Vyukov
fc3361d7af manager: enable fuzzer verbosity only if -debug flag is given
It is not useful to pass manager verbosity flag to fuzzer,
as fuzzer output is not visible. But it increases amount of fuzzer
output that needs to be parsed by manager. Also increased fuzzer
verbosity reduces effective crash log size (less programs fit).
Enable fuzzer verbosity only if debug flag is given.
2016-10-09 09:41:30 +02:00
Dmitry Vyukov
7de2937037 manager: overwrite old reports with new reports
Save up to 100 reports. If we already have 100, overwrite the oldest one.
Newer reports are generally more useful. Overwriting is also needed
to be able to understand if a particular bug still happens or already fixed.
2016-10-07 22:04:58 +02:00
Dmitry Vyukov
191a429c4c manager: save user tag with crash reports
If config contains "tag" parameter, save it along with crash reports.
The tag is meant to contain kernel branch/commit hash.
If workdir contains crashes from different kernel versions,
it is useful to be able to find out on what kernel revision a crash happened.
2016-10-07 21:42:56 +02:00
Dmitry Vyukov
fbaafcd200 manager: don't alter /proc/sys/debug/exception-trace
It should be handled by image (create-image.sh already sets it to 0).
2016-10-07 21:38:56 +02:00
Dmitry Vyukov
d21c3c878c syz-gce: add autonomous GCE runner
It is meant to download new kernel images from GCS,
update and rebuild syzkaller and restart syz-manager.
Work in progress...
2016-10-07 18:56:45 +02:00
Dmitry Vyukov
2da6f4a8e1 manager: precreate crashes dir
http handler scrapes crashes dir, it becomes upset if the dir is missing
2016-10-07 18:42:52 +02:00
Dmitry Vyukov
ff62857ef3 manager: fix html table markup 2016-10-07 09:25:42 +02:00
Dmitry Vyukov
f032ffb788 manager: unify handling of various stats in web ui 2016-10-06 19:53:32 +02:00
Dmitry Vyukov
ec073e08ad manager: show crashes in web ui 2016-10-06 18:48:14 +02:00