1773 Commits

Author SHA1 Message Date
Dmitry Vyukov
4016fc5ad7 prog: fix hints of data args
Hints for data args don't work.
We do all the work, but at the final stage we patch
arg in the _old_ program, not in the _new_ one.
So programs passed to the callback are all the same
and don't contain any mutations.
Tests did not catch this because they work right before that point
(don't test the actual interface function MutateWithHints).

Fix that and add a test that catches this.
2017-12-08 10:45:11 +01:00
Dmitry Vyukov
5c1e6a291b tools/syz-execprog: extend hints output
Print call number because one is usually interested
in a particular call only.
2017-12-08 10:25:41 +01:00
Dmitry Vyukov
c29495e0f9 prog: append a bunch of bytes during mutation
In some cases we need to extend a buffer by a large
margin to pass the next if in kernel (a size check).
Currently we only append a single byte, so we can
never pass the if incrementally (size is always
smaller than threshold, so 1-byte larger inputs
are not added to corpus).
2017-12-08 10:22:56 +01:00
Dmitry Vyukov
c0e5b8c81f tools: include selinux packages when building images
These packages are required to actually activate selinux during boot.
2017-12-08 10:19:09 +01:00
Dmitry Vyukov
fadd10ac05 sys/linux: add a simple description for selinux 2017-12-08 10:15:04 +01:00
Dmitry Vyukov
08c5c8bfdd dashboard/app: fix manager failed build reset
Only reset manager failed build if it uploaded _new_
successful build. On manager restart it uploads its
_old_ working build, and it should not reset a later
failed build.
2017-12-07 10:28:40 +01:00
Dmitry Vyukov
5d643f8e70 dashboard/app: fix typo in template 2017-12-06 13:12:38 +01:00
Dmitry Vyukov
a65439d5fd dashboard/app: add "pass through" reporting status
ReportingPassThrough is mostly the same as ReportingDisabled,
but dalays "special" bugs (no report, corrupted report, build error, etc).
2017-12-06 13:12:38 +01:00
Dmitry Vyukov
528deaed27 syz-ci: combine build.ID from both kernel tag and syzkaller commit
Builds with equal IDs are merged by dashboard,
so if only syzkaller commit has changed
dashboard won't create a new build and the new
syzkaller commit will be lost.
2017-12-06 13:12:38 +01:00
Dmitry Vyukov
b1d1979cc6 dashboard/app: improve error message
For some reason people sometimes drop syzbot from CC.
Then we receive the message from mailing list and can't
find the corresponding bug.
Log email subject in such cases so that it's easier to find
the corresponding email thread.
2017-12-06 13:12:38 +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
e8062ae15f dashboard/app: show more crashes on bug page
We have maxCrashes crashes without reproducers + arbitrary number
of crashes with reproducers. Crashes with reproducers can be stale.
Show more crashes.
2017-12-05 20:08:06 +01:00
Dmitry Vyukov
9a976e63d1 pkg/report: add proper oops format for kernel reboot 2017-12-05 20:08:06 +01:00
Dmitry Vyukov
64d31856d9 executor: unshare PID namespace even for sandbox=none
Unshare as much as we can for all sandboxing modes.
This fixes "kernel panic: Attempted to kill init!" crashes
under sandbox=none. And should just generally improve
reproducibility, e.g. if we unshare SYSVSEM fuzzer won't
collide with any existing semaphores.
2017-12-05 20:08:06 +01:00
Dmitry Vyukov
c2c4cd4e57 executor: treat fail-nth errors as non-fatal
We see occasional ENOENT/EACCES errors returned.
It seems that fuzzer somehow gets its hands to it.
2017-12-05 20:08:06 +01:00
Dmitry Vyukov
d9c79f8842 vm/gce: always ignore serial relay errors
GCE serial reply seems to be buggy, we see lots of "serialport: VM disconnected"
and "packet_write_wait: Connection to 1.2.3.4 port 9600: Broken pipe"
errors, which do not have any explanation.
Ignore all serial relay errors.
2017-12-05 20:08:06 +01:00
Dmitry Vyukov
1aecf4ed31 syz-manager/mgrconfig: add another flavour of OOM messages 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
de212f1a05 dashboard/app: show manager addresses 2017-12-04 12:13:10 +01:00
Dmitry Vyukov
09582d5306 syz-manager: send public web addr to dashboard 2017-12-04 11:58:55 +01:00
Dmitry Vyukov
9118cb4ae2 syz-ci: rebuild syzkaller on restart
Forced syzkaller updates is the main reason for syz-ci restarts.
Reduce syzkaller freshness threshold from 6h to 1m.
Rebuilding syzkaller is relatively cheap anyway.
2017-12-04 11:31:31 +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
Dmitry Vyukov
f5e771b200 dashboard/app: add drop namespace functionality
dropNamespace drops all entities related to a single namespace.
Use with care. There is no undo.
This functionality is intentionally not connected to any handler.
To use it, first make a backup of the datastore. Then, specify the target
namespace in the ns variable, connect the function to a handler, invoke it
and double check the output. Finally, set dryRun to false and invoke again.
2017-12-04 09:00:36 +01:00
Dmitry Vyukov
96ca35f4c7 dashboard/app: show info about duplicates and similar bugs
Show info about duplicates and similar bugs in other kernels
on the bug page.
2017-12-04 09:00:28 +01:00
Dmitry Vyukov
48359b9777 dashboard/app: improve needRepro
Don't reproduce corrupted reports.
Don't reproduce if canonical bug already has repro.
2017-12-01 17:27:08 +01:00
Dmitry Vyukov
948edf8055 dashboard/app: cosmetic changes to manager stats 2017-12-01 17:13:23 +01:00
Andrey Konovalov
e0375d3ee6 pkg/report: return raw log in Report.Output 2017-12-01 16:16:28 +01:00
Dmitry Vyukov
a6f9669d26 dashboard/app: fix misspelled field in template
Also change code to catch such bugs in tests in future.
The problem was that template.Execute already wrote something
into w before returning error, so though the function
returned an error we served 200 instead of 500.
2017-12-01 14:20:03 +01:00
Dmitry Vyukov
2fa91450df dashboard/app: add manager monitoring
Make it possible to monitor health and operation
of all managers from dashboard.
1. Notify dashboard about internal syz-ci errors
   (currently we don't know when/if they happen).
2. Send statistics from managers to dashboard.
2017-12-01 13:58:11 +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
eddaedbb9c tools/syz-crush: fix for new multi-target world 2017-11-30 10:20:34 +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
Dmitry Vyukov
3a80fe350d prog: support bytesizeN for vma
I guess this is currently unused,
but ignoring bytesizeN for vma looks wrong.
If user asks for bytesizeN for vma, divide vma size by N.
2017-11-29 11:12:47 +01:00
Ed Maste
1a6a7478c2 docs: use 'c++' to build on FreeBSD
Building the executor via `gcc executor/executor_freebsd.cc ...`
requires that a GCC package first be installed on the FreeBSD VM image.
The FreeBSD base system comes with Clang already installed, so we can
build via `c++ executor/executor_freebsd.cc ...` and avoid having to
install additional packages.
2017-11-29 08:55:05 +01:00
Dmitry Vyukov
1808de66ce prog: repair arrays/buffers with incorrect size in Deserialize
For string[N] we successfully deserialize a string of any length.
Similarly for a fixed-size array[T, N] we successfully deserialize
an array of any size.
Such programs later crash in foreachSubargOffset because static size
Type.Size() does not match what we've calculated iterating over fields.
The crash happens only in SerializeForExec in syz-fuzzer,
which is especially bad.
Fix this from both sides:
1. Validate sizes of arrays/buffers in Validate.
2. Repair incorrect sizes in Deserialize.
2017-11-28 19:15:28 +01:00
Dmitry Vyukov
e338ada43c dashboard/app: fix purging of old crashes
We sorted by Report (which is a random int ID) instead of ReportLen.
Sort by ReportLen (order is opposite of what of queryCrashesForBug uses).
2017-11-28 17:52:24 +01:00
Andrey Konovalov
7bd85f2aea pkg/report: fix corrupted stack trace detection
Look for stack frames in the next 10 lines after 'Call Trace' instead of 3.
2017-11-28 15:54:13 +01:00
Dmitry Vyukov
ac93d7e1d8 pkg/compiler: add check that len does not refer to array with varlen elements
This [almost] always means a bug in descriptions.
Fix all bugs identified by the check.
2017-11-28 14:55:21 +01:00
Dmitry Vyukov
afba0b55e6 sys/linux: add binder descriptions 2017-11-27 15:09:30 +01:00