Commit Graph

98 Commits

Author SHA1 Message Date
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
13134c3cf7 syz-prog2c: fix a typo in error message 2017-01-25 11:05:19 +01:00
Dmitry Vyukov
40c6a8ebf5 tools/create-image.sh: add psmisc package for killall
+ raise console output level, otherwise stack traces may be dropped
2017-01-24 10:03:42 +01:00
Dmitry Vyukov
3db67897de tools/kcovtrace: add KCOV-based tracing utility
kcovtrace is like strace but show kernel coverage collected with KCOV.
It is very simplistic at this point and does not support multithreaded processes, etc.
It can be used to understand, for example, exact location where kernel bails out
with an error for a particular syscall.
2017-01-20 14:56:20 +01:00
Dmitry Vyukov
f8b6a5831c tools/syz-benchcmp: add utility for visualization of syz-manager benchmarking results 2017-01-20 14:56:20 +01:00
Dmitry Vyukov
52165c91c2 tools/syz-stress: switch to the new corpus database format 2017-01-17 17:14:11 +01:00
Dmitry Vyukov
5d3f1d6614 tools/syz-db: add new utility
The utility allows to pack/unpack corpus database to/from seprate files.
2017-01-16 20:44:01 +01:00
Dmitry Vyukov
6f52004fcf tools/create-image.sh: simplify script
Checkout necessary packages during debootstrap instead of a separate step.
2017-01-16 20:34:35 +01:00
Dmitry Vyukov
e715b3c803 syz-gce: support continous build
Add "local" mode in which syz-gce clones, builds and
monitors for updates a linux kernel repo.
2017-01-16 20:33:22 +01:00
Dmitry Vyukov
83a8f430c9 vm/qemu: add some kvm-related kernel cmd line flags
In particular it is useful to enable nested.
Enable a bunch of others as well.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
b6f204a7e4 syz-stress: add flag that controls generation of new programs 2017-01-09 20:20:49 +01:00
Dmitry Vyukov
3f9152d9e2 vm/qemu: enable more kvm features in test kernel 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
f83633edbe tools/syz-symbolize: add report symbolizer utility 2016-12-16 15:53:30 +01:00
Dmitry Vyukov
60fd47e308 tools/create-image.sh: install sudo into the image 2016-12-07 15:58:51 +01:00
Dmitry Vyukov
2b1456887b tools/create-image.sh: use net.core.bpf_jit_enable = 1
bpf_jit_enable = 2 causes printing of all programs to console.
Produces lots of output and is not very useful. Disable it.
2016-12-07 10:17:46 +01:00
Dmitry Vyukov
ee3c2c3591 tools: enable bpg jit in create-image.sh
JIT should be more interesting to fuzz.
2016-11-28 18:26:56 +01:00
Dmitry Vyukov
ef040b21d2 tools: fix getty configuration in create-gce-image.sh 2016-11-28 18:25:49 +01:00
Alexander Popov
1e56aff95f tools: fix getty configuration in create-image.sh
create-image.sh adds the string "V0:23:respawn:/sbin/getty 115200 hvc0" to inittab
of a virtual machine, but a fresh debian-wheezy doesn't have a hvc0 device.
So getty fails to start and respawns over and over again:
  INIT: Id "V0" respawning too fast: disabled for 5 minutes

Let's fix create-image.sh to have a working VM terminal.

Signed-off-by: Alexander Popov <alex.popov@linux.com>
2016-11-28 16:10:09 +03:00
Andrey Konovalov
253a40f30d sys: add proc type to denote per proccess integers 2016-11-25 17:51:41 +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
a5df734b8d fuzzer: combine progs from corpus 2016-11-25 09:58:17 +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
59f7c210d0 repro: factor out of syz-repro tool
Factor out repro logic from syz-repro tool,
so that it can be used in syz-manager.
Also, support sandboxes in code generated by
csoure. This is required to reproduce crashes
that require e.g. namespace sandbox.
2016-11-19 10:00:36 +01:00
Dmitry Vyukov
2d05f5a6bc tools/create-gce-image.sh: enable bpf jit and update comments 2016-11-16 13:19:33 +01:00
Dmitry Vyukov
b6f882e066 tools/syz-crush: add new tool
syz-crush replays crash log on multiple VMs. Usage:
   syz-crush -config=config.file execution.log
Intended for reproduction of particularly elusive crashes.
2016-11-16 13:19:33 +01:00
Dmitry Vyukov
6f057a2c04 vm/qemu: remove debug, add rodata=n to kernel cmd line
Debug leads to too verbose output in some cases.
Rodata is very slow with KASAN.
2016-10-16 08:15:24 +02:00
Dmitry Vyukov
752469137f tools/create-gce-image.sh: add vsyscall=native to cmdline
Required for android as vdso is disabled by default for some reason.
2016-10-13 15:33:35 +02:00
Dmitry Vyukov
0c1a91b184 tools/create-gce-image.sh: create archive for syz-gce
Create archive ready to use with syz-gce (pack disk image,
vmlinux, key and tag into a single tar.gz).
Also use sudo only for specific commands, otherwise we create key
file readable only root which is inconvinient.
2016-10-10 18:08:58 +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
a65c55ac2f tools/create-gce-image.sh: remove duplicate console argument 2016-10-07 19:58:25 +02:00
Dmitry Vyukov
13813fd6f6 tools: fix package name in a comment 2016-10-07 13:44:26 +02:00
Dmitry Vyukov
171bcbc050 tools: add script that creates GCE images 2016-10-06 16:22:35 +02:00
Dmitry Vyukov
83374d77d3 vm/gce: add support GCE VMs 2016-10-06 16:22:35 +02:00
Dmitry Vyukov
e3e75519de execprog: remove debug leftover 2016-09-06 15:43:24 +02:00
Dmitry Vyukov
e25b79fa98 stress: fix flag description 2016-09-05 12:49:47 +02:00
Dmitry Vyukov
cb3e5c28a0 execprog: make syz-execprog work more like syz-fuzzer
Respect max concurrency.
Optionally print programs to stdout.
2016-09-05 12:49:47 +02:00
Dmitry Vyukov
40280fa543 syz-repro: fix false "not executing programs" 2016-09-05 12:49:47 +02:00
Dmitry Vyukov
2c881152ef syz-report: fix printing of report 2016-09-05 12:49:47 +02:00
Dmitry Vyukov
0e77b5a187 manager, repro: unify VM monitoring
Unify and factor out VM monitoring loop used in syz-manager and syz-repro.
This allows syz-repro to detect all the same bugs (e.g. "no output", "lost connection", etc).
And also just deduplicates code.
2016-09-01 19:54:55 +02:00
Dmitry Vyukov
9ec6b54fae report: add a function that symbolizes reports 2016-09-01 15:09:39 +02:00
Dmitry Vyukov
bb1e3bfda5 report: extract better, unique identifiers of oopses 2016-08-31 13:20:57 +02:00
Dmitry Vyukov
14dfa4f109 report: add a new package for report parsing and processing
Move vm.FindCrash to the new package.
2016-08-30 15:19:28 +02:00
Dmitry Vyukov
bc9b349bd7 vm/adb: support multiple adb devices
Device IDs are specified in "devices" config param.
2016-08-30 14:33:39 +02:00
Dmitry Vyukov
0113f7f048 repro: a little bit more graceful shutdown
Bring down at least some VM instances.
Booting instances can still leak.
2016-08-28 20:09:05 +02:00
Dmitry Vyukov
f0eccc7052 repro: use correct sandbox mode
Update #59
2016-08-28 13:51:09 +02:00
Dmitry Vyukov
888b041f6d csource: support nonfailing argument copyin/copyout
Update #59
2016-08-28 12:24:39 +02:00
Dmitry Vyukov
4782c2b8e6 executor: revive setuid sandbox
The new namespace-based sanboxing is good,
but it's not always what one wants
(and also requires special kernel configs).

Change dropprivs config value to sandbox,
which can have different values (currently: none, setuid, namespace).
Setuid mode uses setuid(nobody) before fuzzing as before.

In future we can add more sandboxing modes or, say,
extend -sandbox=setuid to -sandbox=setuid:johndoe
to impersonolate into given user.
2016-07-01 22:26:33 +02:00
Dmitry Vyukov
85da6413f9 stress: expect syz-executor to be in the current dir by default 2016-06-22 15:23:56 +02:00
Jamie Liu
016f6be69b stress: fix "assignment to entry in nil map" panic 2016-06-14 16:03:26 -07:00