Commit Graph

218 Commits

Author SHA1 Message Date
Dmitry Vyukov
f07ea3fc22 sys/linux: remove get_kernel_syms, add quotactl syscall
get_kernel_syms does not seem to be present upstream.
Describe an old quotactl syscall.
Also fix umount/umount2 names in kallsyms.
2017-11-20 17:23:24 +01:00
Dmitry Vyukov
9badd05327 vm/gce: provide VM console output on boot failures
"can't ssh into the instance" is not a very useful error.
2017-11-19 12:29:00 +01:00
Dmitry Vyukov
a1469efbdd pkg/email: unsplit arguments for test command 2017-11-17 20:43:47 +01:00
Dmitry Vyukov
00f6ff581c pkg/email: truncate garbage after patches 2017-11-17 18:54:19 +01:00
Dmitry Vyukov
fba338cd51 pkg/csource: add function to parse serialized options
Also move options and options tests into a separate file,
add serialization function.
2017-11-17 17:57:51 +01:00
Dmitry Vyukov
3fb087023a pkg/osutil: properly set gid for sandboxing 2017-11-17 14:28:45 +01:00
Dmitry Vyukov
e3d7179396 pkg/git: fix branch during fetch 2017-11-17 14:17:47 +01:00
Dmitry Vyukov
2f7fc0ff65 pkg/kernel: sandbox make invocation 2017-11-17 14:56:34 +03:00
Dmitry Vyukov
c4d43f4773 pkg/osutil: don't leace runaway processes
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
2017-11-16 12:48:02 +01:00
Dmitry Vyukov
9a98ae3fb6 pkg/git: provide more helper functions
Add Patch, Checkout, CheckRepoAddress and CheckBranch.
Will be needed for patch testing.
2017-11-16 10:12:17 +01:00
Dmitry Vyukov
95cf3e7247 pkg/email: fix base64-encoded body parsing
We currently handle base64 only for attachments,
but text/plain body can also be base64-encoded.
2017-11-16 10:10:12 +01:00
Dmitry Vyukov
447a290a8c pkg/config: provide SaveData function
Parallel to LoadFile/LoadData.
2017-11-16 10:10:12 +01:00
Dmitry Vyukov
cf38de0018 pkg/report: avoid compiling a bunch of regexps on every crash 2017-11-14 10:16:27 +01:00
Dmitry Vyukov
bbbea5a373 pkg/report: pass report as []byte to isCorrupted
We always pass report/log as []byte.
Pass it here the same way for consistency and to avoid
unnecessary large memory allocation/copy.
2017-11-14 10:13:38 +01:00
Dmitry Vyukov
4bd78cef05 pkg/report, pkg/repro, syz-manager: name crash attributes consistently
We currently have several names for crash attributes, which is disturbing.
E.g. crash title is called "Title" or "Desc". Name them consistently.

Title - single line bug identity.
Report - whole crash text.
Log - whole fuzzer/kernel output.
2017-11-14 10:04:22 +01:00
Dmitry Vyukov
82b3b903a0 pkg/report: make isCorrupted linux-specific
isCorrupted is linux-specific, but is a global function.
Name can collide with other OSes. Make is linux method.
2017-11-14 09:47:44 +01:00
Dmitry Vyukov
10112655d7 vm: remove needOutput arg for MonitorExecution
Always wait 10 secs for output.
If anything this can only lead to missed crashes during repro.
Let's unify manager and repro behavior.
2017-11-14 09:45:34 +01:00
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
dd1609f876 executor: proceed even if /dev/net/tun is not available
For some racy bugs syzkaller can generate a C reproducer with tun
enabled, when it's not actuallly required to trigger the bug.
Some kernel developers (that don't have CONFIG_TUN=y on their setups)
complain about such C repros.
When tun is not available, instead of exiting, print a message that tun
initialization failed and proceed.
2017-11-08 17:43:40 +01:00
Dmitry Vyukov
6c412fa20c pkg/git: add another commit prefix 2017-11-08 14:16:36 +01: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
8f3e774b76 syz-ci: improve commit matching
1. Fetch last 200K commits instead of commits for past year.
For merged commits both author date and commit date can be
arbitrary long in past (e.g. we got a commit dated by 2014).

2. Strip some commit prefixes from commits.
We have some trees where backports are prefixed with "BACKPORT:".
Previously we could no match such commits.
2017-11-07 13:31:00 +01:00
zoulasc
0460a8dda0 csource: Fix sed(1) invocation
There is no need to specify '-' as the filename for sed(1):
- The default behavior is to read stdin
- It was not done in all places
- It breaks on NetBSD sed(1) (although I am tempted to fix it now :-)
  and it does not work
2017-11-06 11:27:45 +03:00
Dmitry Vyukov
6ddaf205ad dashboard/app: email fixes
1. Allows sending emails upstream.
2. Filter out duplicate emails coming from our mailing lists.
3. Increase retry attempts for email commands
   (don't want them to fail due to concurrent crash reports from managers).
2017-10-31 10:06:02 +01:00
Dmitry Vyukov
636a4dbf38 pkg/csource: add freebsd/netbsd support 2017-10-26 15:31:23 +02:00
Dmitry Vyukov
0038451914 pkg/report: add netbsd stub 2017-10-25 18:36:49 +02:00
Dmitry Vyukov
e729550825 all: basic building on netbsd
This just makes make TARGETOS=netbsd succeed.
We don't yet have prog target for netbsd.
2017-10-23 10:10:05 +02:00
Dmitry Vyukov
6755f62592 syz-fuzzer: fix manager polling
We need to always poll manager to send stats/maxsignal,
we just need not request candidates if we have plenty of work.
2017-10-23 09:59:39 +02:00
Dmitry Vyukov
afa9178d57 pkg/ipc: fix reading comp hints
if/else branches are intermixed
2017-10-23 09:59:39 +02:00
Dmitry Vyukov
ab829b1b0b pkg/report: more linux spinlock oops messages 2017-10-22 14:30:13 +02:00
Dmitry Vyukov
3704c60135 executor: fix build breakages due to doexit
Some standard libraries contain "using ::exit;",
which breaks with the current redefinition of exit.
2017-10-19 11:06:05 +02:00
Dmitry Vyukov
f26811f080 pkg/ast: fix TestParseAll 2017-10-19 10:45:27 +02:00
Dmitry Vyukov
6a4810dd45 pkg/report: strip unnecessary info from "workqueue lockup" crashes 2017-10-18 16:56:05 +02:00
Dmitry Vyukov
296be8cc8d pkg/ipc: move fallback coverage into executor
It seems to explode linux corpus.
So make it freebsd-specific.
2017-10-18 16:49:25 +02:00
Dmitry Vyukov
f89294761c executor: use forkserver for freebsd
Use forkserver and shmem for freebsd.
This greatly improves speed.
Also introduce fallback coverage signal based
on unique (syscall+errno) pairs.
2017-10-18 12:01:24 +02:00
Dmitry Vyukov
6368c469a5 pkg/report: support freebsd 2017-10-18 12:01:24 +02: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
6a06c36fe1 pkg/report: don't use access size for KASAN reports
Including access size potentially leads to failure to deduplicate
reports when size comes from user or for racy bugs (bug is detected
on different accesses depending on timings).
We already drop size from UAF and OOB, drop it for other bug types.
2017-10-17 15:09:01 +02:00
Dmitry Vyukov
c2337c94bf executor: fix akaros nonfailing mode 2017-10-16 14:21:54 +02:00
Dmitry Vyukov
85b1f93f8d executor, pkg/ipc: unify ipc protocol between linux and other OSes
We currently use more complex and functional protocol on linux,
and a simple ad-hoc protocol on other OSes.
This leads to code duplication in both ipc and executor.
Linux supports coverage, shared memory communication and fork server,
which would also be useful for most other OSes.

Unify communication protocol and parametrize it by
(1) use of shmem or only pipes, (2) use of fork server.

This reduces duplication in ipc and executor and will
allow to support the useful features for other OSes easily.

Finally, this fixes akaros support as it currently uses
syz-stress running on host (linux) and executor running on akaros.
2017-10-16 14:21:54 +02:00
Dmitry Vyukov
f78642861b pkg/csource: support akaros 2017-10-16 14:21:54 +02:00
Dmitry Vyukov
63c290f77c pkg/host: add akaros support 2017-10-16 14:21:54 +02:00
Dmitry Vyukov
f0565e6231 executor: write debug output to stderr
We print all other output to stderr, write debug output to stderr as well.
This does not matter for the main use case of running syz-execprog -debug,
but can is helpful if we want to communicate with syz-executor via stdin/stdout.
2017-10-16 14:21:54 +02:00
Dmitry Vyukov
66aeb467de pkg/ipc: don't send program padding to executor
Currently we always send 2MB of data to executor in ipc_simple.go.
Send only what's consumed by the program, and don't send the trailing zeros.
Serialized programs usually take only few KBs.
2017-10-12 19:08:18 +02:00
Dmitry Vyukov
95a2bea795 pkg/ipc, pkg/osutil: remove filepath.Abs fuchsia workarounds
This claimed to be fixed:
https://fuchsia.atlassian.net/browse/DNO-158
2017-10-12 10:16:39 +02:00
Dmitry Vyukov
c2aee24101 executor: include missing header
writev requires <sys/uio.h>. Include it.
2017-10-10 19:03:04 +02:00
Dmitry Vyukov
4906c32192 pkg/ipc: extend error when fail to start executor
We currently return raw error, so sometimes it's hard to tell
even what call produced the error (e.g. just "invalid argument").
Extend the error so that it's clear that it comes from cmd.Start.
2017-10-10 18:59:23 +02:00
Dmitry Vyukov
354c324465 syz-fuzzer: don't send/check CallIndex for inputs
The call index check episodically fails:

2017/10/02 22:07:32 bad call index 1, calls 1, program:

under unknown circumstances. I've looked at the code again
and don't see where/how we can mess CallIndex.
Added a new test for minimization that especially checks resulting
CallIndex.
It would be good to understand what happens, but we don't have
any reproducers. CallIndex is actually unused at this point.
Manager only needs call name. So remove CallIndex entirely.
2017-10-10 10:41:27 +02:00
Dmitry Vyukov
179a860885 all: basic freebsd support
For now we just make Go part build for freebsd.
2017-10-02 14:17:32 +02:00