Commit Graph

1290 Commits

Author SHA1 Message Date
Dmitry Vyukov
032fb6f70a syz-ci: send commits to dashboard
Dashboard needs to know when bug fixing commits reach
builders in order to fully close bugs.
Send commits that dashboard is interested in to dashboard.
2017-07-28 20:14:24 +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
Dmitry Vyukov
68c70116f3 pkg/symbolizer: fix race on inputr in test
Pointed out by race detector.
2017-07-25 10:52:35 +02:00
Andrey Konovalov
c70b8a2cff pkg/report: fix symbolization of old KASAN stack trace format
Which has a tab instead of a space at the beginning of each frame
in alloc and free stack traces.
2017-07-24 20:50:42 +02:00
Andrey Konovalov
0d9ae38d5d pkg/repro: disable Debug flag by default 2017-07-24 14:31:25 +02:00
Andrey Konovalov
e83310d8a2 pkg/csource: make all usleeps random
We can't know the exact values of those sleeps in advance, they can be
different for different bugs. Making them random increases the chance that
the C repro executes with the right timings at some point.
2017-07-24 14:22:54 +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
240b07788c pkg/hash: allow to hash multiple byte slices
Hash/String now allow to hash mutiple byte slices
without copying them into a single slice first.
2017-07-21 10:06:46 +02:00
Andrey Konovalov
56db83c58a pkg/report: replace lines numbers with LINE in report headers 2017-07-19 17:20:19 +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
7c1ee0634b tools/create-gce-image.sh: ignore SIGINT
If the script is aborted at an unfortunate point, it leaves the whole system broken.
E.g. we've seen that fdisk cannot update partition table until the next reboot.
If you really need to kill it, use a different signal. But better wait.
2017-07-17 14:45:41 +02:00
Dmitry Vyukov
8382eb648f pkg/kernel: actually pass cmdline/sysctl files to the build script 2017-07-17 14:45:41 +02:00
Dmitry Vyukov
cc1c342923 syz-ci: allow to specify cmdline/sysctls
Allow to specify per-kernel command line and sysctl values
to more closely mimic the target kernel.
2017-07-17 12:39:11 +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
Dmitry Vyukov
f68d78b5a8 pkg/email: fix bug in context extraction
Compare email addresses without full name.
2017-07-05 21:29:41 +02:00
Dmitry Vyukov
6fe1bcf384 pkg/email: add AddAddrContext/RemoveAddrContext
Replace extractBugID function with more general AddAddrContext/RemoveAddrContext.
2017-07-05 19:45:56 +02:00
Dmitry Vyukov
6231964849 pkg/csource: reformat 2017-07-05 19:45:25 +02:00
Andrey Konovalov
d50208f93e pkg/csourse: don't generate __NR_X defines for old syscalls 2017-07-05 15:46:38 +02:00
Andrey Konovalov
918a566afd pkg/repro: return crash report 2017-07-05 15:40:55 +02:00
Dmitry Vyukov
ebabe267cd pkg/email: don't add own email address to CC list
Otherwise we we send each reply to ourselves and receive it again.
2017-07-03 18:24:39 +02:00
Dmitry Vyukov
2181ef35e1 pkg/osutil: don't depend on syscall in appengine build
Dashboard app now depends on osutil through config package.
Reshuffle functions so that the package does not depend
on syscall in appengine build.
2017-07-03 14:43:37 +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
Dmitry Vyukov
1438a6de81 pkg/report: strip panic message from reports
If panic_on_warn set, then we frequently have 2 stacks:
one for the actual report (or maybe even more than one),
and then one for panic caused by panic_on_warn. This makes
reports unnecessary long and the panic (current) stack
is always present in the actual report. So we strip the
panic message. However, we check that we have enough lines
before the panic, because sometimes we have, for example,
a single WARNING line without a stack and then the panic
with the stack.
2017-07-03 13:18:40 +02:00
Dmitry Vyukov
eb1cda04f3 pkg/email: add function that forms reply to an email 2017-07-02 16:08:04 +02:00
Dmitry Vyukov
233bc790fc pkg/email: add email parsing functionality
Parse extracts all potentially interesting info from an incoming email.
2017-07-02 15:40:24 +02:00
Dmitry Vyukov
1b20342f25 pkg/email: move patch parsing from pkg/kernel
ParsePatch is used by appengine app.
Appengine apps can't depend on syscall/unsafe,
but pkg/kernel currently does.
Move patch parsing to pkg/email which does not
depend on syscall/unsafe.
2017-06-30 16:20:19 +02:00
Dmitry Vyukov
c2028e38d2 pkg/report: change arg of ExtractGuiltyFile to []byte
We usually store reports as []byte, not as string. They can be large.
So change arg type to []byte.
Also rename it from log to report. In our terminology log is
not symblized/processed crash output. What this function wants
is called report in manager.
2017-06-30 15:09:57 +02:00
Dmitry Vyukov
909ccbe28f pkg/config: support time.Time fields 2017-06-30 14:36:34 +02:00
Dmitry Vyukov
c5b6fcddca syz-hub: split client name and manager name
This allows to reduce number of hub clients by grouping managers
and creating one client per such group.
2017-06-29 17:50:44 +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
3ad6daa90a report: add get maintainers function 2017-06-26 21:23:14 +02:00
Dmitry Vyukov
d8daf57eca pkg/csource: regenerate 2017-06-26 15:34:54 +02:00
Andrey Konovalov
dd93f0378a repro: reproExtractProg may fail (#254) 2017-06-26 15:30:54 +02:00
Andrey Konovalov
913a0cfe5a report: add more rcu stall regexps 2017-06-26 14:13:22 +02:00
Dmitry Vyukov
b3ae011196 pkg/osutil: port to darwin 2017-06-26 13:43:20 +02:00
Dmitry Vyukov
8ebb2147d9 pkg/fileutil: port to darwin 2017-06-26 13:42:52 +02:00
Dmitry Vyukov
0b4cf413ea Merge pull request #241 from dvyukov/dvyukov-ci
syz-ci: add continuous integration system
2017-06-22 16:27:37 +02:00
Andrey Konovalov
268bf907e1 Merge pull request #239 from xairy/up-better-repro
Minor reproducing improvements
2017-06-21 19:39:57 +02:00
Dmitry Vyukov
fea266b33f pkg/osutil: add FilesExist/CopyFiles/LinkFiles functions
Will be required by the new build system.
2017-06-20 19:59:47 +02:00
Dmitry Vyukov
e39114dc0c pkg/kernel: move partial config functionality into a separate function
Move partial config functionality into BuildWithPartConfig.
It is used only for syz-gce which will be removed soon.
Provide a better interface for new continuous build system.
2017-06-20 19:59:42 +02:00
Dmitry Vyukov
5cc5b2714e pkg/fileutil: improve CopyFile
Make CopyFile atomic and preserve permissions.
2017-06-20 19:53:13 +02:00
Dmitry Vyukov
99d2454c57 pkg/git: improve Poll
Support changing repo/branch and force pushes.
2017-06-20 19:52:50 +02:00
Dmitry Vyukov
f94617a321 pkg/kernel: reduce Build parallelism
NumCPU*2 can create excessive number of subprocesses
in the case machine is busy with other things as well.
2017-06-19 16:48:46 +02:00
Dmitry Vyukov
9dcb6799c7 pkg/kernel: fix CreateImage
- Move does not work across filesystems (i.e. tmpfs->disk)
- set proper permissions for ssh key
2017-06-19 16:47:42 +02:00
Dmitry Vyukov
4799d21e01 pkg/osutil: fix IsExist
Currently it returns true for "/some/existing/file/foo"
because that returns ENOTDIR.
2017-06-19 16:44:39 +02:00
Dmitry Vyukov
b6e969be7a pkg/osutil: add helper function for SIGINT handling 2017-06-19 16:43:23 +02:00
Dmitry Vyukov
a89409fa44 pkg/log: add Fatal function
Replacement for Fatalf("%v", err).
2017-06-19 16:38:38 +02:00
Dmitry Vyukov
98bf8f451c pkg/git: check origin repo in Poll 2017-06-19 16:37:31 +02:00
Dmitry Vyukov
7e63cfac7f pkg/fileutil: improve CopyFile
- check Close error
- preserve modification time
2017-06-19 16:35:52 +02:00
Dmitry Vyukov
261cdc2564 pkg/config: add SaveFile function 2017-06-19 16:34:59 +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
e130d95518 vm/gce: accept un-tar-ed image
vm/gce differs from other VM types in that it accepts image
in a weird, GCE-specific format (namely, image named disk.raw
is put into .tar.gz file). This makes it impossible to write
generic code that creates images for any VM types.

Make vm/gce accept just image like e.g. vm/qemu
and handle own specifics internally.
2017-06-17 17:06:29 +02:00
Dmitry Vyukov
017b5dea53 pkg/symbolizer: move from symbolizer 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
949ccff832 pkg/rpctype: from from rpctype 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
68621900a3 pkg/report: move from report 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
e8e63830a6 pkg/ipc: move from ipc 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
ec95d17c32 pkg/cover: move from cover 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
6fd7a75a91 pkg/repro: move from pkg 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
4b2a9e225c pkg/host: move from host 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
13c5bfcc6e pkg/osutil: add IsExist helper function 2017-06-17 12:11:24 +02:00
Dmitry Vyukov
4c571f8413 pkg/kernel: add an option to provide full config for build
Normally config is applied on top of defconfig+kvmconfig.
This allows to provide full config that is used unmodified.
2017-06-15 18:29:47 +02:00
Dmitry Vyukov
c8a3e46192 pkg/git: fix git fetch command line 2017-06-15 18:29:47 +02:00
Dmitry Vyukov
c64814428a pkg/kernel: skip test if gcc is not in PATH
gcc is not necessary available everywhere.
Skip the test instead of failing it.
2017-06-14 13:19:28 +02:00
Dmitry Vyukov
54e36636a1 syz-dash: move patch parsing to pkg/kernel
Patch parsing is not dashboard-specific and can
be reused by other programs.
2017-06-14 10:18:10 +02:00
Dmitry Vyukov
b512286f25 pkg/git: don't use --no-tags with clone
It's not supported in older versions of git.
2017-06-03 14:04:16 +02:00
Dmitry Vyukov
b6faa91366 pkg/gcs: remove support for gs:// prefixed paths
The problem with gs:// is that after any filepath.Join
it's transformed to gs:/ which is not recognized.
It's safer to not allow specifying them at all,
rather than constantly breaking them.
2017-06-03 13:16:39 +02:00
Dmitry Vyukov
b08ca73a6e pkg/config: support null values 2017-06-03 13:16:18 +02:00
Dmitry Vyukov
b68d01eea0 vm/gce: accept local image
Currently gce accepts precreated GCE image name as image config param,
while all other VM types accept local file path as image.
This makes it impossible to write generic code that works with all VM types,
i.e. after building a new image it's unclear if it needs to be uploaded
to GCE or not, and what needs to be passed as image in config.

Eliminate this difference by making gce accept local image file as well.
2017-06-03 11:48:19 +02:00
Dmitry Vyukov
af643baa32 vm: overhaul
VM infrastructure currently has several problems:
 - Config struct is complete mess with a superset of params for all VM types
 - verification of Config is mess spread across several places
 - there is no place where VM code could do global initialization
   like creating GCE connection, uploading GCE image to GCS,
   matching adb devices with consoles, etc
 - it hard to add private VM implementations
   such impl would need to add code to config package
   which would lead to constant merge conflicts
 - interface for VM implementation is mixed with interface for VM users
   this does not allow to provide best interface for both of them
 - there is no way to add common code for all VM implementations

This change solves these problems by:
 - splitting VM interface for users (vm package) and VM interface
   for VM implementations (vmimpl pacakge), this in turn allows
   to add common code
 - adding Pool concept that allows to do global initialization
   and config checking at the right time
 - decoupling manager config from VM-specific config
   each VM type now defines own config

Note: manager configs need to be changed after this change:
VM-specific parts are moved to own "vm" subobject.

Note: this change also drops "local" VM type.
Its story was long unclear and there is now syz-stress which solves the same problem.
2017-06-03 11:31:42 +02:00
Dmitry Vyukov
96b8d4e99c pkg/config: support nested structs 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
46c6ed89bf pkg/ifuzz: move from ifuzz 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
a6bed21731 pkg/gce: move from gce 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
ea2295f3e2 pkg/db: move from db 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
23b94422d3 pkg/log: move from log 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
d1032c21a0 pkg/hash: move from hash 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
03ad13e655 pkg/kernel: add CompilerIdentity function 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
5d2b332ab5 pkg/gcs: add new package
Move GCS-related functionality from syz-gce
to a separate package.
2017-06-03 10:41:09 +02:00
Dmitry Vyukov
66fd442d48 pkg/fileutil: move from fileutil 2017-06-03 10:41:09 +02:00
Dmitry Vyukov
1a7e5fb38d pkg/kernel: add new package
Move functionality to build kernel/image
from syz-gce to a separate package.
2017-06-03 10:41:09 +02:00
Dmitry Vyukov
4d6cb372ad pkg/git: add new package
Move few helper git-related functions from syz-gce
to a separate pkg/git package.
2017-06-01 12:01:51 +02:00
Dmitry Vyukov
84eb5fd389 config: split and refactor
Introduce generic config.Load function that can be
reused across multiple programs (syz-manager, syz-gce, etc).
Move the generic config functionality to pkg/config package.
The idea is to move all helper (non-main) packages to pkg/ dir,
because we have more and more of them and they pollute the top dir.
Move the syz-manager config parts into syz-manager/config package.
2017-06-01 11:17:54 +02:00