Commit Graph

1216 Commits

Author SHA1 Message Date
Andrey Konovalov
2b21a44565 prog: return error instead of panic when parsing 2017-07-24 16:37:24 +02:00
Andrey Konovalov
1e06f3e00f Merge pull request #274 from xairy/up-better-repro
Improve C repros
2017-07-24 14:34:34 +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
87f9bdb868 dashboard/dashapi: add customizable Qeury function
Query is useful for tests and other contexts
where non-standard request creation/sending is necessary.
2017-07-21 12:43:09 +02:00
Dmitry Vyukov
0f42bbec24 syz-ci: extend dashboard interface
1. Add manager name to builds.
2. Add centralized logging.
3. Add types for bug reports and bug updates.
2017-07-21 10:06:46 +02:00
Dmitry Vyukov
1a3751c444 syz-ci: save previous manager log
If manager exits during start, it's hard to understand what happens.
Save the previous manager log as manager.log.old until we have a better solution.
Also log errors on 0 log level.
2017-07-21 10:06:46 +02:00
Dmitry Vyukov
0bdcc49799 syz-manager: fix repro saving
If manager is connected to dashboard it now does not save crashes.
Which means that when we save a repro the crash dir may not exist yet.
Create the dir when saving repros.
2017-07-21 10:06:46 +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
c5d0c9e318 Merge pull request #285 from xairy/up-fix-recursion
prog: allow recursion for optional pointers
2017-07-19 18:38:22 +02:00
Andrey Konovalov
0c7a205ae5 Merge pull request #286 from xairy/up-better-headers
pkg/report: replace lines numbers with LINE in report headers
2017-07-19 18:27:34 +02:00
Andrey Konovalov
1e9794774b Merge pull request #287 from xairy/up-fix-repro-log
Small fixes in manager dashboard report
2017-07-19 18:27:09 +02:00
Andrey Konovalov
d1e3265562 syz-manager: don't print empty tag on report page 2017-07-19 17:35:40 +02:00
Andrey Konovalov
f9f0e027d8 syz-manager: fix repro log filename 2017-07-19 17:32:48 +02:00
Andrey Konovalov
56db83c58a pkg/report: replace lines numbers with LINE in report headers 2017-07-19 17:20:19 +02:00
Andrey Konovalov
94f1595a77 prog: allow recursion for optional pointers
When syzkaller generates arg that uses a few structs that reference each
other via pointers, it can go into infinite recursion and crash.

Fix this by forcing pointer args to be null when the depth of recursion
reaches 3 for some struct.
2017-07-19 15:46:50 +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
012622d3c9 syz-ci: fix dashboard settings in manager config 2017-07-18 16:34:33 +02:00
Dmitry Vyukov
50cd6f06ef Update linux_kernel_configs.md 2017-07-18 14:00:26 +02:00
Dmitry Vyukov
9e1407a678 vm/isolated: reformat 2017-07-18 09:58:53 +02:00
Thomas Garnier
3fd92b9694 Add Isolated VM
Add a new isolated VM for machines that you cannot easily manage. It
assumes the machine is only available through SSH and create a reverse
proxy to ensure the machine can connect back to syz-manager.

Signed-off-by: Thomas Garnier <thgarnie@google.com>
2017-07-18 09:57:38 +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
Andrey Konovalov
7cdb3c70f7 Merge pull request #280 from xairy/up-split-arg
prog: split Arg into smaller structs
2017-07-17 14:42:11 +02:00
Andrey Konovalov
cfc46d9d0b prog: split Arg into smaller structs
Right now Arg is a huge struct (160 bytes), which has many different fields
used for different arg kinds. Since most of the args we see in a typical
corpus are ArgConst, this results in a significant memory overuse.

This change:
- makes Arg an interface instead of a struct
- adds a SomethingArg struct for each arg kind we have
- converts all *Arg pointers into just Arg, since interface variable by
  itself contains a pointer to the actual data
- removes ArgPageSize, now ConstArg is used instead
- consolidates correspondence between arg kinds and types, see comments
  before each SomethingArg struct definition
- now LenType args that denote the length of VmaType args are serialized as
  "0x1000" instead of "(0x1000)"; to preserve backwards compatibility
  syzkaller is able to parse the old format for now
- multiple small changes all over to make the above work

After this change syzkaller uses twice less memory after deserializing a
typical corpus.
2017-07-17 14:34:09 +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
e489b6cafd syz-ci: don't duplicate manager config default values 2017-07-17 12:39:11 +02:00
Dmitry Vyukov
0fd1458dba syz-ci: specify dashboard client per manager
Dashboard will need to distinguish managers
to understand what kernel they are testing.
2017-07-17 12:39:06 +02:00
Dmitry Vyukov
558280a686 tools/create-image.sh: create 2G images
1G does not seem to be enough.
Create 2G images as we do in create-gce-image.sh.
2017-07-17 09:56:08 +02:00
Dmitry Vyukov
8d1e709552 syz-manager: symbolize repro reports
We now take reports from repro and they are not symbolized.
Symbolize them.
2017-07-13 18:46:24 +02:00
Andrey Konovalov
bc44358170 Update found_bugs.md 2017-07-06 15:02:30 +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
Dmitry Vyukov
1841d5a558 syz-ci: don't rebuild syzkaller if commit has not changed 2017-07-05 19:44:57 +02:00
Andrey Konovalov
1b780baf30 Merge pull request #271 from xairy/up-syscall-defines
pkg/csourse: don't generate __NR_X defines for old syscalls
2017-07-05 15:51: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
8adc4a749d Merge pull request #272 from xairy/up-repro-return
pkg/repro: return crash report
2017-07-05 15:41:20 +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
e7b1c55592 syz-ci: fix manager config creation
Don't write hub/dashboard params if they are not enabled
in syz-ci config. Otherwise manager gets name but not addr/key,
and that does not pass config validation.
2017-07-03 14:23:35 +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
7f03d6d553 syz-manager: switch to the new dashboard 2017-06-30 16:09:50 +02:00