Commit Graph

291 Commits

Author SHA1 Message Date
Dmitry Vyukov
52a20ba400 dashboard/app: properly handle build failures
Separate kernel and syzkaller build failures.
Fix logic to understand when a build is fixed:
look if kernel/syzkaller commit changes to understand
if it's a new good build or re-upload of an old build.

Fixes #1014
2019-03-25 17:00:25 +01:00
Andrew Donnellan
54779150a6 syz-manager: fix typo in dashboard stats upload error
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
2019-03-20 07:47:17 +01:00
Dmitry Vyukov
3e98cc3080 dashboard/app: poll commits info
This implements 2 features:
 - syz-ci polls a set of additional repos to discover fixing commits sooner
   (e.g. it can now discover a fixing commit in netfilter tree before
   it reaches any of the tested trees).
 - syz-ci uploads info about commits to dashboard.
   For example, a user marks a bug as fixed by commit "foo: bar".
   syz-ci will find this commit in the main namespace repo
   and upload commmit hash/date/author to dashboard. This in turn
   allows to show links to fixing commits.

Fixes #691
Fixes #610
2019-02-17 15:08:45 +01:00
Dmitry Vyukov
b97b12358e syz-manager: restore disabled syscall logging
We reset disabled syscalls before checking them.
As the result no diagnostics printed. Reset them after checking.
2019-02-01 10:02:24 +01:00
Michael Tuexen
2103a236f1 syz-manager: provide config name in Stats 2019-01-18 13:20:33 +01:00
Dmitry Vyukov
025b20b5cb syz-manager: fix up commit link 2019-01-16 14:48:49 +01:00
Joey Jiao
d5d60d1061 syz-manager: add repo version and config link on stats page 2019-01-16 14:38:28 +01:00
Michael Tuexen
3d85f48c14 syz-manager: Improve the computation of getVMOffset() on FreeBSD
On FreeBSD getVMOffset() always returned 0 instead of 0xffffffff.
This breaks the usage of addr2line. For now, just return always
0xffffffff on FreeBSD, since a more sophisticated logic doesn't
seem to be required by now.

Thanks to Dmitry for pointing out that this functions provides
the prefix address.
2018-12-31 19:36:13 +01:00
Dmitry Vyukov
85d28281fb syz-manager: factor out rpc serving part
Update #605
2018-12-26 10:58:23 +01:00
Dmitry Vyukov
88f5934633 vm: allow fine-grained control over program exit conditions
Currently we only support canExit flag.
However there are actually 3 separate conditions:
 - program can exit normally
 - program can timeout (e.g. fuzzer test or runtest can't)
 - program can exit with error (e.g. C test can)
Allow to specify these 3 conditions separately.
2018-12-24 09:59:56 +01:00
Dmitry Vyukov
ba64d006de prog: implement strict parsing mode
Add bulk of checks for strict parsing mode.
Probably not complete, but we can extend then in future as needed.
Turns out we can't easily use it for serialized programs
as they omit default args and during deserialization it looks like missing args.
2018-12-10 16:37:01 +01:00
Dmitry Vyukov
95fe19c19e prog: introduce strict parsing mode
Over time we relaxed parsing to handle all kinds of invalid programs
(excessive/missing args, wrong types, etc).
This is useful when reading old programs from corpus.
But this is harmful for e.g. reading test inputs as they can become arbitrary outdated.
For runtests which creates additional problem of executing not
what is actually written in the test (or at least what author meant).
Add strict parsing mode that does not tolerate any errors.
For now it just checks excessive syscall arguments.
2018-12-10 16:37:01 +01:00
Dmitry Vyukov
5dd495422e syz-manager: move coverage report code to pkg/cover
This will allow better testing and make it possible to reuse this code.
2018-12-10 16:37:01 +01:00
Dmitry Vyukov
13ab4beeef syz-manager: modernize web UI
1. Use dashboard style.
2. Allow sorting of tables.
3. Show old crashes in grey.
4. Use tables instead of text output for more pages.
5. Show corpus inputs on a separate page to allow copy-pasting.
6. Use standard JS sorting instead of custom bubble sort (much faster).
7. Fix off-by one in table sorting.

Fixes #694
2018-11-22 14:36:32 +01:00
Dmitry Vyukov
e8722ddd83 syz-manager: fix syscall prio page
It currently crashes as we never populate mgr.prios now.
Calculate prios on the fly instead.

Fixes #797
2018-11-12 12:27:34 -08:00
Dmitry Vyukov
1b410967ce syz-manager: don't upload failed leak repro attempts to dashboard
We did not upload the crash itself, so dashboard does not know about them.
2018-10-10 14:04:36 +02:00
Dmitry Vyukov
137d7c662e syz-manager: don't send memory leaks without repros to dashboard
KMEMLEAK has lots of false positives and bugs without repros
may be unactionable. It's not completely clear how to handle
such cases in automatic systematic testing.
But let's try this and see how it works.
2018-09-28 15:18:02 +02:00
Dmitry Vyukov
7296c0747f pkg/host: improve KMEMLEAK support
Rewind kmemleak fd before reading it second time,
otherwise we will read truncated reports.

Auto-learn what leak reports we've already seen
and ignore them in future. This is required because
there are some false positives and some fire too frequently.
So now we will hit each leak only once per manager run,
but we still will try to reproduce them.
2018-09-28 14:57:20 +02:00
Dmitry Vyukov
5adbd06eff syz-manager: improve coverage source file path generation
If we don't determine correct prefix (e.g. some paths are not full paths),
we can plumb kernel source path twice. It seems that it's not possible
to do the right thing in all possible combinations of what can be in
debug info, if the kernel sources were moved or not, if we have kernel_src
or not. But at least don't plumb kernel_src second time.
2018-09-20 11:22:57 +02:00
Dmitry Vyukov
ff2962ae80 syz-ci: de-hardcode kernel object file names
We used to have this list in syz-ci and syz-managers.
Now we have kernel object in sys/targets, so use it instead.

Update #712
2018-09-11 15:43:55 +02:00
Anton Lindqvist
d0e00721b8 sys/targets: allow the name of kernel to be specified per target
Assuming the kernel is named vmlinux does not work for OpenBSD.
2018-09-01 21:46:58 -07:00
Dmitry Vyukov
d7fda14afc syz-manager: don't minimize corpus if it hasn't changed
Corpus minimization can lead to a livelock after a batch of crashes.
Minimize corpus only if it grew by at least 1% since last time.
2018-08-30 22:55:11 -07:00
Dmitry Vyukov
2b5d3da50f syz-manager: fix number of syscalls in web ui 2018-08-04 17:55:19 +02:00
Dmitry Vyukov
2763e04c22 tools/syz-runtest: add tool for program unit testing
The tool is run as:

$ syz-runtest -config manager.config

This runs all programs from sys/*/test/* in different modes
on actual VMs and checks results.

Fixes #603
2018-08-03 21:08:02 +02:00
Dmitry Vyukov
976e4de048 syz-manager: refactor work with hub
Move work with hub into a separate file and fully separate
its state from the rest of the manager state.
First step towards splitting manager into managable parts.
This also required to rework stats as they are used throughout the code.

Update #538
Update #605
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
fbedd425b5 pkg/mgrconfig: move from syz-manager/mgrconfig
mgrconfig was used only by syz-manager initially,
but now it's used by a dozen of packages and it's
weird to import from under a binary dir.
pkg/ is much more reasonable dir for a widely used
helper package.
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
d5b1542a54 syz-manager/mgrconfig: refactor more
Complete is still too long and complex. Split more.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
15d078f2b6 syz-manager/mgrconfig: remove the deprecated vmlinux parameter 2018-08-02 16:57:31 +02:00
Dmitry Vyukov
a5892295bf syz-manager/mgrconfig: refactor Complete
Split the very long function into 2.

Update #538
2018-08-02 16:57:31 +02:00
Dmitry Vyukov
e65f4e79e3 syz-manager/mgrconfig: better handling of unknown os/arch
Produce a readable error instead of crashing on nil deref.
2018-08-02 16:57:31 +02:00
Zach Riggle
0a7cf4ec63 manager: Fix default value for 'sandbox' (#666)
docs: fix default sandbox value

The docs and code comments state in several places that 'setuid'
is the default sandbox value.  However, the default is actually
'none'.  Fix docs.
2018-08-01 19:42:07 +02:00
Dmitry Vyukov
ba6c552acd syz-manager: refactor vmLoop
Slightly reduce cyclomatic complexity.

Update #538
2018-07-31 18:43:50 +02:00
Julia Hansbrough
a922a2e809 [manager] Fix typo.
s/cash/crash/
2018-07-25 08:28:36 +02:00
Jiangen Jiao
f69c5fcd76 syz-manager: Support kernelSrc and vmlinux from different tree
If vmlinux built from different tree from kernelSrc, cover page will failed to
show. So match only the path without prefix.
2018-07-23 09:52:04 +02:00
Dmitry Vyukov
93213ec0d3 syz-manager/mgrconfig: default kernel_src to kernel_obj
... which in turn defaults to vmlinux.
This makes it possible to only specify vmlinux or only kernel_obj.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
ef387e080a syz-manager: don't print loop state on info requests
Printing loop state on info requests (e.g. due to http requests)
is somewhat confusing as no state change actually happens.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
04bd6c3d9e pkg/instance: pass -os to execprog/fuzzer only for akaros
Only akaros needs OS, because the rest assume host OS.
But speciying OS for all OSes breaks patch testing on syzbot
because old execprog does not have os flag.
2018-07-06 14:43:24 +02:00
Dmitry Vyukov
538df42ec7 pkg/repro: provide stats even for failed repro
Provide stats and logs for failed repro and save it in manager.
In particular log is useful for failed repros,
currently there is no visibility into why bugs
failed to reproduce.
2018-07-05 13:14:00 +02:00
Dmitry Vyukov
cf4583c661 syz-manager: pass OS to fuzzer
Needed for akaros.
2018-07-05 10:44:34 +02:00
Dmitry Vyukov
f7498af7af prog: add stronger fallback signal
Also mixin resource constructors and some signature
of flags values for successful calls into fallback coverage.
2018-06-29 20:34:43 +02:00
Dmitry Vyukov
0a971ab1d0 syz-manager: implement fallback coverage report 2018-06-29 18:15:41 +02:00
Dmitry Vyukov
68ce63c468 pkg/build: support fuchsia builds 2018-06-28 13:42:07 +02:00
Dmitry Vyukov
e502f1a6df docs: remove mentions of vmlinux
vmlinux is deprecated in favor of kernel_obj.
Remove all mentions of it.
Also warn in syz-manager/mgrconfig if vmlinux is set.
2018-06-28 13:42:04 +02:00
Dmitry Vyukov
4dd045dff9 syz-manager: remove unused field 2018-06-26 19:02:01 +02:00
Dmitry Vyukov
e726bdf922 syz-manager: make rpc communication finer grained
RPC package does excessive caching per connection,
so if a larger object is ever sent in any direction,
rpc connection consumes large amount of memory persistently.
This makes manager consume gigs of memory with large
number of VMs and larger corpus/coverage.

Make all communication done in very limited batches.
2018-06-26 13:59:47 +02:00
Dmitry Vyukov
2a075d57ab pkg/report: allow to specify suppressions per OS
Currently all (linux-specific) suppressions are hardcoded in mgrconfig.
This is very wrong. Move them to pkg/report and allow to specify per OS.
Add gvisor-specific suppressions.
This required a bit of refactoring. Introduce mgrconfig.KernelObj finally.
Make report.NewReporter and vm.Create accept mgrconfig directly
instead of passing it as multiple scattered args.
Remove tools/syz-parse and it always did the same as tools/syz-symbolize.
Simplify global vars in syz-manager/cover.go.
Create reporter eagerly in manager. Use sort.Slice more.
Overall -90 lines removed.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
c31f96a8c6 executor: rework fallback coverage
We have fallback coverage implmentation for freebsd.
1. It's broken after some recent changes.
2. We need it for fuchsia, windows, akaros, linux too.
3. It's painful to work with C code.

Move fallback coverage to ipc package,
fix it and provide for all OSes.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
9a7d0a5412 pkg/report: pass vm type to NewReporter
For the case when VM type affects output.
Will be needed for gvisor. It is kinda linux, but kinda not.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
87bfb99cfe vm: pass instance to MonitorExecution
It may need it later to try to obtain additional
diagnostic from hanged instances.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
45c54f755c syz-manager: fix race during reporter init 2018-06-18 19:50:50 +02:00