Commit Graph

801 Commits

Author SHA1 Message Date
Dmitry Vyukov
badabe5ac0 pkg/report: improve parsing of "corrupted stack end detected inside scheduler" 2018-12-30 12:19:54 +01:00
Dmitry Vyukov
4ebd1f1e83 pkg/report: improve double fault parsing
Ignore double faults as start of a second report.
Double fault can happen during handling of paging faults
if memory is badly corrupted. Also it usually happens
synchronously, which means that maybe the report is not corrupted.
But of course it can come from another CPU as well.

Add more interesting test cases.
2018-12-30 10:04:42 +01:00
Dmitry Vyukov
2ccf0adec3 pkg/report: parse linux stack corruption reports 2018-12-30 09:39:28 +01:00
Dmitry Vyukov
35e3f847cf executor: fix linux includes
Builds in one distro, but another says:

In file included from <stdin>:39:0:
/usr/powerpc64le-linux-gnu/include/linux/if.h:143:8: error: redefinition of ‘struct ifmap’
/usr/powerpc64le-linux-gnu/include/net/if.h:111:8: note: originally defined here

Mess. Try to fix it.
Not sure what's the right solution and it it even exists.
2018-12-29 22:05:57 +01:00
Dmitry Vyukov
bf3be553de executor: use netlink instead of ip command to setup net devices
ip command caused several problems:
1. It is installed in different locations or
not installed at all in different distros.
2. It does not support latest kernel devices,
e.g. setup of hsr currently fails because
our ip does not understand its custom prose.
3. ip command is slow, unbearably slow in emulator
(full setup takes tens of seconds). This change
reduces setup from ~2s to ~400ms.
4. ip is not present in gvisor, but it will support netlink.

Use netlink directly to solve all these problems.
2018-12-29 19:22:34 +01:00
Dmitry Vyukov
3d48fa5a53 executor: log failure in write_file
Almost all callers of write_file just log the failure.
Log the failure in write_file directly to remove
lots of "error handling" code.
2018-12-29 19:22:34 +01:00
Dmitry Vyukov
af3175049a pkg/csource: split emitCall function
gometalinter points that emitCall is too complex.
Factor out call name emission.
2018-12-27 14:00:42 +01:00
Dmitry Vyukov
2b084c9886 pkg/csource: use 0 for missing syscall args
We don't specify trailing unused args for some syscalls
(e.g. ioctl that does not use its arg).
Executor always filled tailing unsed args with 0's
but pkg/csource didn't. Some such syscalls actually
check that the unsed arg is 0 and as the result failed with C repro.

We could statically check and eliminate all such cases,
but it turns out the warning fires in 1500+ cases:
a3ace5a63f/gistfile1.txt

So instead fill such args with 0's in pkg/csource too.
2018-12-27 13:11:57 +01:00
Dmitry Vyukov
8e3d1cba5a pkg/ipc: clarify why we close inwp explicitly
Fixes #897
2018-12-27 11:04:49 +01:00
Dmitry Vyukov
e747ec987b pkg/csource: fix PRINTF removal
PRINTF now accepts arguments.
2018-12-26 22:06:07 +01:00
Dmitry Vyukov
586a19e7ec executor: create more net devices on linux 2018-12-26 21:44:05 +01:00
Dmitry Vyukov
85d28281fb syz-manager: factor out rpc serving part
Update #605
2018-12-26 10:58:23 +01:00
Dmitry Vyukov
4f7962a7bb executor: restrict ipc resource usage
For context see:
https://groups.google.com/d/msg/syzkaller-bugs/ZaBzAJbn6i8/Py9FVlAqDQAJ
2018-12-26 10:29:43 +01:00
Dmitry Vyukov
dd61e58d94 sys/linux: extend AX25/ROSE/NETROM descriptions 2018-12-24 18:56:06 +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
Anton Lindqvist
be79df56ff pkg/report: lower uvm_fault oops precedence to favor more specific titles 2018-12-24 06:48:44 +01:00
Anton Lindqvist
fa2887794d pkg/report: normalize OpenBSD assertion messages 2018-12-24 06:48:44 +01:00
Dmitry Vyukov
588075e659 pkg/report: split overly complex function
gometalinter points to testParseImpl cyclomatic complexity.
2018-12-21 10:16:58 +01:00
Dmitry Vyukov
2b4970017d pkg/report: fix Start/EndPos calculation for fuchsia
We computed Start/EndPos after trimming line prefix,
this resulted in offsetted values which are not correct.
Fix that. Add more tests and checks for Start/EndPos.
2018-12-20 13:22:46 +01:00
Dmitry Vyukov
dbe573e3b8 pkg/osutil: always remove old file in Rename 2018-12-20 13:22:46 +01:00
Greg Steuck
a8b6d1af46 pkg/build/openbsd: always make clean to manage config in tree
clean build barely takes 3 minutes end-to-end on our CI machine.

Undo debug options which caused prevented kernels from booting on GCE.
2018-12-19 17:15:31 +01:00
Dmitry Vyukov
4edaba9329 pkg/vcs: disable sandboxing in tests
syz-ci disabling does not work across syz-ci updates.
2018-12-18 12:48:59 +01:00
Dmitry Vyukov
a9cc88c19f pkg/osutil: provide better Rename
os.Rename fails for cross-device renaming (e.g. to/from tmpfs).
This is quite unpleasant. Provide own version that falls back to copying.
2018-12-17 19:09:10 +01:00
Dmitry Vyukov
b38da77e00 pkg/bisect: check existence of input files
It's better to fail early then to wait for kernel build.

Update #501
2018-12-17 19:09:03 +01:00
Dmitry Vyukov
61adbb167e pkg/vcs: don't use --no-tags when fetching git
pkg/bisect uses Poll and then relies on tags for compiler detection.
Don't use --no-tags when fetching.

Update #501
2018-12-17 19:08:52 +01:00
Dmitry Vyukov
1749e412ca pkg/instance: make kernel reboot detection portable
The current code is linux specific, generalize it to other OSes.
2018-12-16 16:48:05 +01:00
Dmitry Vyukov
ce6744512e pkg/vcs: fix fetching of commits on non master branch
Fixes #728
2018-12-16 16:18:06 +01:00
Dmitry Vyukov
def91db3fe prog, pkg/csource: more readable serialization for strings
Always serialize strings in readable format (non-hex).
Serialize binary data in readable format in more cases.

Fixes #792
2018-12-15 15:17:13 +01:00
Dmitry Vyukov
7a944a0a66 pkg/report: fix RIP line symbolization
Don't subtract 1 for RIP lines.

Fixes #361
2018-12-15 13:36:01 +01:00
Dmitry Vyukov
dd2fb82fa0 pkg/report: another gvisor OOM suppression 2018-12-13 16:45:56 +01:00
Dmitry Vyukov
61b76f0097 pkg/report: another gvisor OOM suppression 2018-12-13 16:40:18 +01:00
Dmitry Vyukov
e7cae6a7f2 pkg/report: another gvisor OOM suppression 2018-12-13 16:36:15 +01:00
Dmitry Vyukov
ecf8ceeef2 pkg/report: pkg/report: relaxed gvisor OOM suppressions more
There are more variations of this panic format.
2018-12-13 12:33:17 +01:00
Dmitry Vyukov
a553162c82 pkg/report: replace more moving parts in gvisor crash titles
"container" seems to have been renamed to "sandbox".
Also exact pid numbers are harmful.
2018-12-13 12:29:52 +01:00
Dmitry Vyukov
3f9ec66365 pkg/report: relaxed gvisor OOM suppressions
Existing ones don't match actual gvisor output after address mangling.
Not matching exact context in parens should be good enough re false positives.
2018-12-13 12:22:49 +01:00
Greg Steuck
f3d9d5948c pkg/csource: support tun and setuid repros on {free,open}bsd
* expose procid on BSD for tun, always declare loop()
* deal with terrible bsd includes
* replicate loop() declaration
2018-12-13 09:44:24 +01:00
Michael Pratt
ec0147d47f Merge pull request #874 from prattmic/bazel_version
pkg/build: fix bazel version parsing
2018-12-13 09:38:59 +01:00
Michael Pratt
1789e8d66c pkg/report: update gvisor ptrace regs suppressions
99d5958693
changed the format of these to include the registers.
2018-12-13 09:38:16 +01:00
Dmitry Vyukov
0f9424b449 pkg/report: skip strncpy in linux reports 2018-12-12 13:05:51 +01:00
Greg Steuck
d90f8af59c executor: reapply setuid sandbox for bsd
* Revert "Revert "executor: add setuid sandbox for openbsd""

The problem is the low file descriptor limit.

This reverts commit 4093e33b13.

* executor/executor make sure the file descriptor limit is sufficient
2018-12-11 07:39:44 +01:00
Greg Steuck
4093e33b13 Revert "executor: add setuid sandbox for openbsd"
This reverts commit 6565f24da9.
2018-12-10 20:09:24 +01:00
Dmitry Vyukov
c7ba317e9b tools/syz-runtest: test program parsing before booting VMs
It sucks to wait for VMs to boot just to discover that programs don't parse.
2018-12-10 16:37:02 +01:00
Dmitry Vyukov
593b260b02 pkg/ipc: move sandbox helpers from ipcconfig
Currently syz-runtest fails to start because -debug flag is defined
both in syz-runtest and ipcconfig.
But moving sandbox functions we prevent ipcconfig from being imported into syz-runtest.
2018-12-10 16:37:02 +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
Greg Steuck
6565f24da9 executor: add setuid sandbox for openbsd
* executor/common_bsd: add setuid sandbox

Fixes #833

cc @mptre

* Reduced duplications, resolved TODO.
2018-12-10 11:20:16 +01:00
Dmitry Vyukov
c791837863 executor: fix handling of big-endian bitfields
Currently we apply big-endian-ness and bitfield-ness in the wrong order in copyin.
This leads to totally bogus result. Fix this.
2018-12-08 19:08:08 +01:00
Anton Lindqvist
3350826625 pkg/report: add initial symbolize suppport to OpenBSD 2018-12-08 18:59:10 +01:00
Anton Lindqvist
4e1aade2fe pkg/report: pass the target to each OS report constructor
In order to use the already defined kernel name in sys/targets to reduce
duplications.
2018-12-08 18:59:10 +01:00
Greg Steuck
610352d5d7 pkg/build/openbsd: require kernel config files as configuration data
Previously the config was generated directly, but testing multiple
configurations makes this cumbersome going forward. This makes
kernel_config a mandatory parameter.
2018-12-07 09:50:12 +01:00