Commit Graph

83 Commits

Author SHA1 Message Date
Dmitry Vyukov
7a53e7e35d pkg/report: combine report data into a struct
Parse returns 5 variables now. Later we may want to add crash "priority".
Introduce Report struct that holds all report data.
2017-11-14 09:41:55 +01:00
Andrey Konovalov
f9a8d567eb pkg/report: add corrupted report detection
This change makes pkg/report try to detect corrupted reports by
using some heuristics.
2017-11-13 17:18:16 +03:00
Andrey Konovalov
a2c64463a2 execprog: correctly handle fault injections
syz-execprog doesn't utilize info about fault injections from a prog log.
Since syz-execprog is used by the repro package to reproduce crashes,
crashes caused by fault injections might not reproduce.
2017-11-07 16:17:18 +01:00
Dmitry Vyukov
85c802e4cf pkg/report: support multiple OSes
Introduce report.Reporter interface.
Add an implementation per-OS.
Make users be explicit about OS they are testing.
2017-10-18 12:01:24 +02:00
Dmitry Vyukov
324664de57 pkg/repro: fix nil target in prog 2017-09-22 13:16:24 +02:00
Dmitry Vyukov
4f60e46e49 syz-manager: check that files we are using are not changing under us
If kernel or syzkaller binaries are rebuilt when manager uses them,
nothing good will happen. Manager can start mixing coverage from
old and new kernels, or crash on unknown syscalls.
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
19f9bc13d3 pkg/csource: support archs other than x86_64 2017-09-15 16:02:37 +02:00
Dmitry Vyukov
52a33fd516 prog: remove default target and all global state
Now each prog function accepts the desired target explicitly.
No global, implicit state involved.
This is much cleaner and allows cross-OS/arch testing, etc.
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
c0cabacda7 syz-fuzzer, syz-execprog: add -arch flag
arch flag specifies target arch, which can be different from GOARCH.
For example, 386 executor with amd64 fuzzer.
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
7e288c0531 pkg/repro: minimize fault injection 2017-08-09 15:41:52 +02:00
Dmitry Vyukov
32e29dda2c pkg/repro: fix invalid options minimization
Repro can generate Sandbox="namespace"/UseTmpDir=false.
This combination is broken for two reasons:
 - on second and subsequent executions of the program,
   it fails to create syz-tmp dir
 - with Procs>1, it fails right away, because all procs
   try to create syz-tmp dir

Don't generate such combination.
2017-08-09 15:41:52 +02:00
Dmitry Vyukov
8b78527436 pkg/csource, pkg/repro: filter out invalid options combinations
We currently have 2 invalid options combinations:
 - collide without threads
 - procs>1 without repeat
They are invalid in the sense that result of csource.Write
is the same for them. Filter out these combinations.
This cuts csource testing time in half and reduces repro minimization time.
2017-08-09 15:41:52 +02:00
Andrey Konovalov
bbd1f3487b pkg/repro: fix null-ptr-deref when res is nil
res can become nil if one of the repro routines fails with an error.
2017-07-27 14:48:21 +02:00
Andrey Konovalov
3f5c8df22d pkg/repro: fix simplifying threaded flag 2017-07-26 15:07:07 +02:00
Andrey Konovalov
0d9ae38d5d pkg/repro: disable Debug flag by default 2017-07-24 14:31:25 +02:00
Andrey Konovalov
65a2d5fb58 pkg/repro: try extracting C repro before simplifying options
Sometimes C reproducers don't work after the generic prog options were
simplified. This change makes syzkaller to try extracting a C repro before
simplifying prog options and after each simplification step. This gives
us more chance to generate a C reproducer.
2017-07-24 14:22:54 +02:00
Dmitry Vyukov
0107e4124d pkg/repro: save final crash log
Logs are useful in situations where we mess the report.
Since we try to report crashes with reproducers,
we need logs for reproducers.
2017-07-18 18:00:03 +02:00
Dmitry Vyukov
76f45d87f2 syz-manager: save proper report for reproducers
We can start reproducing one crash, but end up reproducing another.
Currently we still attribute the resulting repro to the original crash.
This is wrong.
Save the resulting desc/report for reproducers and use that in manager.
2017-07-06 12:17:39 +02:00
Andrey Konovalov
918a566afd pkg/repro: return crash report 2017-07-05 15:40:55 +02:00
Dmitry Vyukov
a7b199253f all: use consistent file permissions
Currently we have unix permissions for new files/dirs
hardcoded throughout the code base. Some places use 0644,
some - 0640, some - 0600 and a variety of other constants.

Introduce osutil.MkdirAll/WriteFile that use the default
permissions and use them throughout the code base.

This makes permissions consistent and also allows to easily
change the permissions later if we change our minds.

Also merge pkg/fileutil into pkg/osutil as they become
dependent on each other. The line between them was poorly
defined anyway as both operate on files.
2017-07-03 14:00:47 +02:00
Andrey Konovalov
ae33f0dff5 repro: fix tests (#266) 2017-06-29 16:14:39 +02:00
Andrey Konovalov
e379542e8b repro, manager: show repro logs and stats on manager dashboard 2017-06-27 16:27:21 +02:00
Andrey Konovalov
41d7a8a64b repro: add 1 minute duration 2017-06-27 11:59:12 +02:00
Andrey Konovalov
65542325fb repro: add bisection test 2017-06-27 11:59:12 +02:00
Andrey Konovalov
3349d055d7 repro: bisect the log to find multiple guilty programs 2017-06-27 11:59:11 +02:00
Andrey Konovalov
dd93f0378a repro: reproExtractProg may fail (#254) 2017-06-26 15:30:54 +02:00
Andrey Konovalov
81990cb633 repro: small log fix 2017-06-19 15:31:06 +02:00
Andrey Konovalov
a1e85a5688 repro: try more programs with short duration 2017-06-19 15:19:10 +02:00
Andrey Konovalov
864a841818 repro: split ctx.repro() into smaller methods 2017-06-19 14:51:53 +02:00
Andrey Konovalov
02483b6e8e repro: move duration to Result 2017-06-19 14:23:17 +02:00
Dmitry Vyukov
68621900a3 pkg/report: move from report 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
baad3b4b02 pkg/csource: move from csource 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
6fd7a75a91 pkg/repro: move from pkg 2017-06-17 14:41:15 +02:00