Commit Graph

281 Commits

Author SHA1 Message Date
Dmitry Vyukov
779a655b43 pkg/report: add test where we fail to detect corrupted report 2017-12-19 13:39:14 +01:00
Dmitry Vyukov
a87e30dc1b pkg/email: improve parsing of splitted lines
Allow:

full-commit-title-on-next-line

This allows commit titles between 70 and 80 cols with gmail.

Also be more permissive wrt spaces and tabs.
2017-12-19 13:36:40 +01:00
Dmitry Vyukov
d30c3e81eb pkg/report: add test for a bug in report parsing 2017-12-18 15:34:08 +01:00
Dmitry Vyukov
a20097eafe syz-manager, syz-fuzzer: allow re-minimizing/re-smashing inputs
By default we don't re-minimize/re-smash programs from corpus,
it takes lots of time on start and is unnecessary.
However, when we improve/fix minimization/smashing,
we may want to.

Introduce corpus database versions and allow to re-minimize/re-smash
on version bumps.
2017-12-18 14:10:56 +01:00
Dmitry Vyukov
0d231ceb73 syz-fuzzer: refactor
syz-fuzzer organically grew from a small nice main function
into a huge single-file monster with tons of global state.

Start refactoring it into something more managable.
This change separates 2 things:
1. Proc: a single fuzzing process (ipc.Env wrapper).
2. WorkQueue: holds global non-fuzzing work items.
More work needed, but this is good first step.
2017-12-18 09:50:17 +01:00
Dmitry Vyukov
d5beb42ace pkg/csource: make strings more readable
If string contains a file name or a crypto alg name,
don't escape it all to hex.
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
a33677f8bf prog: use dense indexes for copyout instructions
Fixes #174
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
fea5478f46 prog: add DeserializeExec
Factor out program parsing from pkg/csource.
csource code that parses program and at the same time
formats output is very messy and complex.
New aproach also allows to understand e.g.
when a call has copyout instructions which is
useful for better C source output.
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
431d3c90b1 pkg/csource: refactor
csource.go is too large and messy.
Move Build/Format into buid.go.
Move generation of common header into common.go.
Split generation of common header into smaller managable functions.
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
c5826ff7aa pkg/ipc: make threaded/collide per-program options
Currently threaded/collide are global environment flags.
It can be useful to turn off collider during some executions
(minimization, triage, etc).
Make them per-program options.
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
eaeccee1d7 pkg/report: add another test 2017-12-17 11:39:14 +01:00
Dmitry Vyukov
019cf5f235 sys: move test syscalls to a separate target
We have them in linux solely for historical reasons.

Fixes #462
2017-12-17 11:39:14 +01:00
Andrey Konovalov
ea8dc17ee9 executor: fix macros in common.h 2017-12-14 08:54:55 +01:00
Andrey Konovalov
06ea774dca pkg/report: fix __this_cpu_* report header call trace capture 2017-12-13 19:48:13 +01:00
Dmitry Vyukov
414a185f4d pkg/report: add another corruped report format 2017-12-12 15:35:21 +01:00
Dmitry Vyukov
433029d5d4 pkg/report: add another guilty file test 2017-12-12 14:23:28 +01:00
Dmitry Vyukov
32f694fc72 pkg/report: properly infer kernel location if kcov is not enabled
We used to infer kernel source location based on __sanitizer_cov_trace_pc symbol.
But it's not present if KCOV is not enabled.
Look at more symbols.
2017-12-12 14:02:59 +01:00
Dmitry Vyukov
4224245438 pkg/report: add few more corrupted reports 2017-12-12 13:51:27 +01:00
Dmitry Vyukov
867fe6a840 pkg/report: improve using __this_cpu_add() in preemptible code report 2017-12-12 13:40:08 +01:00
Dmitry Vyukov
1b3ae9a6d0 pkg/report: handle syzkaller binaries
syzkallerNNN binaries are coming from pkg/repro.
2017-12-12 13:29:45 +01:00
Dmitry Vyukov
081721ff15 pkg/report: clean guilty files 2017-12-12 12:24:52 +01:00
Dmitry Vyukov
7130893383 pkg/report: merge TestLinuxParseLog into TestParse
That was the last test that used inline input data.
Merge it into TestParse.
Test Output for all crashes in TestParse.
Support multiple oopes in crash
Add more test cases for start/end line.
2017-12-12 12:20:41 +01:00
Dmitry Vyukov
9d0132a2fb pkg/report: move guilty file test data to testdir/
linux_test.go is total mess and very hard to work with.
Turns out we had 2 tests that do exactly the same
(verify Report), but nobody ever noticed.

Move all test data to testdir/. One file per crash.
2017-12-12 11:59:13 +01:00
Dmitry Vyukov
1556ebc4cc pkg/report: move test data to testdir/
linux_test.go is total mess and very hard to work with.
Turns out we had 2 tests that do exactly the same
(verify Report), but nobody ever noticed.

Move all test data to testdir/. One file per crash.
2017-12-12 11:28:37 +01:00
Andrey Konovalov
8d4ab42605 pkg/report: bad unlock balance can be a WARNING 2017-12-11 16:01:10 +01:00
Andrey Konovalov
c0020ec197 pkg/report: detect corrupted old-style KASAN reports 2017-12-11 16:01:10 +01:00
Andrey Konovalov
02b8de13ac pkg/report: better detect corrupted stack traces
We may find stack frames from the second stack trace in a report when
searching from frames of the first one.
2017-12-11 16:01:10 +01:00
Andrey Konovalov
27f5dfefff pkg/report: improve report header extraction
Allow stack traces to be intermixed with random kernel messages that don't
start with a ' ' char (all frames in a stack trace do).

Also improve report headers for BUGs from mm/usercopy.c, as we get quite a
lot of those.
2017-12-11 14:42:45 +01:00
Andrey Konovalov
2d8c311ede pkg/report: fix corrupted call trace detection
linuxSymbolizeRe can match "IP: depot_fetch_stack+0x11/0x40", which is not
part of the call stack trace. Add another regexp that only matches frames.
2017-12-08 15:53:22 +01:00
Andrey Konovalov
20860a992a pkg/report: add arch/*/mm/fault.c to guilty file blacklist 2017-12-08 15:25:06 +01:00
Andrey Konovalov
38a2a3f586 pkg/report: fix report extraction
Try extracting report from console output only first. If that doesn't work,
try extracting it from the whole log.

Add regexp for executor printed BUGs.

Optimize regexps for rcu detected stalls.

Update rep.StartPos and rep.EndPos in vm/vm.go as well as rep.Output.
2017-12-08 15:08:13 +01:00
Dmitry Vyukov
71ac44a0c2 executor: fix build
exitf function was not defined with some combinations of options in csource.
Fix defines and switch exitf back to fail, fail already checks ENOMEM/EAGAIN,
so there is no reason to use exitf in this particular case.
2017-12-06 10:34:58 +01:00
Dmitry Vyukov
9a976e63d1 pkg/report: add proper oops format for kernel reboot 2017-12-05 20:08:06 +01:00
Andrey Konovalov
0796857b79 pkg/report: add log parsing test 2017-12-05 14:19:39 +01:00
Dmitry Vyukov
09582d5306 syz-manager: send public web addr to dashboard 2017-12-04 11:58:55 +01:00
Dmitry Vyukov
84a6637d28 pkg/report: add fuzz test
Found 3 bugs already.
Update #457
2017-12-04 11:10:12 +01:00
Dmitry Vyukov
7a5e495bdf pkg/report: fix out-of-bounds access
Update #457
2017-12-04 11:04:01 +01:00
Dmitry Vyukov
99ea3eaf5b pkg/report: test that Report is never empty
If Parse detects a crash, it must provide something in the Report field.
If Report is empty, something is wrong with parsing.

Update #457
2017-12-04 10:59:53 +01:00
Dmitry Vyukov
c92879679c pkg/report: extinguish panics
We see panic during report parsing as in #457.
This does not really fix them, but should stop managers crashing.

Update #457
2017-12-04 10:53:25 +01:00
Andrey Konovalov
e0375d3ee6 pkg/report: return raw log in Report.Output 2017-12-01 16:16:28 +01:00
Andrey Konovalov
5683420f11 pkg/report, pkg/repro: fix report parsing
pkg/repro expects pkg/report to return CrashStart index in the whole report,
not only in the kernel output.
2017-12-01 09:15:57 +01:00
Andrey Konovalov
16668351f6 pkg/report: improve task hung report headers 2017-11-30 22:35:35 +01:00
Dmitry Vyukov
5153aeaffd syz-ci: test images before using them
Boot and minimally test images before declaring them as good
and switching to using them.

If image build/boot/test fails, upload report about this to dashboard.
2017-11-30 14:50:50 +01:00
Andrey Konovalov
d5bd1f79fd pkg/report: improve trying to register non-static key header 2017-11-30 11:45:21 +01:00
Dmitry Vyukov
29b0fd90e6 pkg/report: include Maintainers into report
Currently getting a complete report requires a complex,
multi-step dance (including getting information that
external users are not interested in -- guilty file).

Simplify interface down to 2 functions: Parse and Symbolize.
Parse does what it did before, Symbolize symbolizes report
and fills in maintainers. This simplifies both implementations
of Reporter interface and all users of the interface.

Potentially we could get this down to 1 function Parse
that does everything. However, (1) Symbolize can fail,
while Parse cannot, (2) usually we want to ignore (log)
Symbolize errors, but otherwise proceed with the report,
(3) repro does not need symbolization for all but the
last report.
2017-11-29 18:24:30 +01:00
Andrey Konovalov
46c864566a pkg/report: improve bad unlock balance corruption detection 2017-11-29 15:18:44 +01:00
Dmitry Vyukov
34f2c2332b pkg/report: add Output to Report
Whole raw output is indivisble part of Report,
currently we always pass Output separately along with Report.
Make Output a Report field.

Then, put whole Report into manager Crash and repro context and Result.
There is little point in passing Report as aa bunch of separate fields.
2017-11-29 14:36:51 +01:00
Andrey Konovalov
19d272a98f pkg/report: detect suspicious RCU usage report corruption 2017-11-29 14:26:38 +01:00
Andrey Konovalov
4263b2afbe pkg/report: add sl*b.c to guilty blacklist 2017-11-29 13:45:46 +01:00
Andrey Konovalov
c2a67000b6 pkg/repro: rerun repro when report is corrupted 2017-11-29 13:23:31 +01:00