Commit Graph

89 Commits

Author SHA1 Message Date
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
Alexander Potapenko
ed787856f2 Use readelf to obtain the upper 32 bits of addresses returned by kcov.
When executors send coverage data to the manager, they clamp the addresses
of covered blocks to 32 bits. Manager uses RestorePC() to restore the original
addresses.
Previously, RestorePC() assumed that the upper 4 bytes of a kernel code
address were 0xffffffff, which is not so on Android.
Instead we now parse `readelf -SW vmlinux` output to obtain the upper bytes of
PROGBITS sections VMAs in the case those VMAs are non-zero. We assume that
the upper 4 bytes are the same for every section.
2016-05-03 11:06:27 +02:00
Dmitry Vyukov
7bc74c0b97 stress: print program and output on more types of bugs 2016-04-04 20:22:10 +02:00
Dmitry Vyukov
9851bc6a97 fuzzer: improve kmemleak logic
Kmemleak has false positives. To mitigate most of them, it checksums
potentially leaked objects, and reports them only on the next scan
iff the checksum does not change. Because of that we do the following
intricate dance:
Scan, sleep, scan again. At this point we can get some leaks.
If there are leaks, we sleep and scan again, this can remove
false leaks. Then, read kmemleak again. If we get leaks now, then
hopefully these are true positives during the previous testing cycle.
2016-03-10 17:47:13 +01:00
Lorenzo Stoakes
827a93b21a tools: fix multi-line string.
An error in the multi-line string results in apt-get install not running in
create-image.sh, this fixes that.
2016-03-08 15:14:48 +00:00
Lorenzo Stoakes
b21724820c tools: fix path on create-image.sh chroot.
When chroot'ing into the generated debian rootfs PATH is inherited from the host
and assumed to reference each of: /bin, /sbin, /usr/bin, /usr/sbin,
/usr/local/bin and /usr/local/sbin. Not all distros use all of these, so enforce
these in the chroot command.
2016-03-06 18:47:43 +00:00
Dmitry Vyukov
96949534ae execprog: properly cleanup on ctrl+C 2016-02-18 21:41:50 +01:00
Dmitry Vyukov
9724efa335 config: check presence of syz-execprog only in syz-repro
syz-execprog is not built by 'make', so syz-manager fails for first-timers.
2016-02-16 15:14:25 +01:00
Dmitry Vyukov
d1163f0480 ipc: unify command line flag handling
It was duplicated in 3 programs.
2016-01-27 14:22:48 +01:00
Dmitry Vyukov
9aec072a77 ipc: remove strace support traces
It is not working and not tested,
and can't be restored with new namespace sandboxing code.
2016-01-27 13:42:00 +01:00