Commit Graph

3264 Commits

Author SHA1 Message Date
Dmitry Vyukov
70b2a9e855 Makefile: collect coverage report for codecov.io 2018-12-31 12:51:07 +01:00
Dmitry Vyukov
c5499485c2 prog: speed up TestResourceCtors
We check each resource multiple times. Check each resource once.
2018-12-31 12:32:14 +01:00
Dmitry Vyukov
21cdbb61b8 docs/syzbot.md: add reference to gcc 9 2018-12-31 09:28:49 +01:00
Dmitry Vyukov
2b42fdc898 sys/linux: detail ifla_vf_policy/ifla_port_policy/ifla_xdp_policy 2018-12-30 17:36:38 +01:00
Dmitry Vyukov
f7d5ee2d34 sys/linux: add can routes 2018-12-30 16:24:31 +01:00
Dmitry Vyukov
5b565c8bdb sys/linux: add AF_RXRPC descriptions 2018-12-30 15:49:07 +01:00
Dmitry Vyukov
9942de5fb0 sys/linux: add /dev/mISDNtimer 2018-12-30 12:25:05 +01:00
Dmitry Vyukov
badabe5ac0 pkg/report: improve parsing of "corrupted stack end detected inside scheduler" 2018-12-30 12:19:54 +01:00
Dmitry Vyukov
6e86ffb020 sys/linux: open more of /dev/ files
/dev/vfio/vfio
/dev/btrfs-control
/dev/ubi_ctrl
/dev/cachefiles
2018-12-30 12:19:52 +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
204cb1446f sys/linux: add AF_ISDN descriptions 2018-12-29 20:40:32 +01:00
Dmitry Vyukov
f02201ce9a sys/linux: describe /dev/vhci interface 2018-12-29 19:22:35 +01:00
Dmitry Vyukov
79059de177 sys/linux: misc assorted improvements
Add new bpf consts/commands.
Refine bluetooth descriptions.
Remove removed crypto consts.
2018-12-29 19:22:35 +01:00
Dmitry Vyukov
6b761be059 dashboard/config: enable more linux net configs
Enable some BT/RXRPC/MAC80211/ISDN configs.
2018-12-29 19:22:34 +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
Michael Tuexen
a2af97ddf7 executor: Fix FreeBSD such all platforms use same number of entries
FreeBSD sets the kcov buffer as number of bytes instead of number
of entries. This also fixes the mmap() call, which was failing
due to inconsistent sizes. The failing was hidden due to wrong
error handling.
2018-12-29 19:17:28 +01:00
Michael Tuexen
e8f58194c1 executor: fix error handling of mmap()
mmap() returns MAP_FAILED, which is (void *)(-1), in case
of an error. This is different from NULL.
2018-12-29 19:17:28 +01:00
Michael Tuexen
8d43fb9c5e executor: add clarifying comment for FreeBSD. 2018-12-29 19:17:28 +01:00
Michael Tuexen
e0cd1d2e84 executor: add a clarifying comment 2018-12-29 19:17:28 +01:00
Michael Tuexen
6aef08ce12 executor: use function argument instead of global variable. 2018-12-29 19:17:28 +01:00
Dmitry Vyukov
a40793d7a5 sys/linux: refine few types in NETLINK_ROUTE 2018-12-29 07:45:20 +01:00
Shankara Pailoor
8ca2b64365 tools/syz-trace2syz/proggen: append 0 to string buffers
String buffers get the null byte added during generation.
This means we need to add the null byte explicitly in trace2syz.
2018-12-29 07:45:10 +01:00
Shankara Pailoor
e33ad0f187 tools/syz-trace2syz: only add null-byte for prog.BufferFilename
trace2syz used to always add a null byte to strings.
This isn't correct behavior since we may end up writing null bytes to files.
The extra byte can affect system calls like ioctl FS_IOC_ENABLE_VERITY.
We now only add the byte for filenames.
2018-12-28 15:18:24 +01:00
Shankara Pailoor
6a33670d2f tools/syz-trace2syz/parser: parse octal numbers
We don't properly parse octal numbers which is an issue because that's how strace decodes file permissions even under -Xraw.
We used to do so but we didn't have a test for it so as when we added support for negative numbers we broke how we parse octals.
This commit fixes how we parse octals and includes a test to catch future regressions.
2018-12-28 13:57:14 +01:00
Michael Tuexen
4898a4328e executor: improve kcov compatibility with upcoming support
Get ioctl() definitions and usage in sync with the upcoming support
reviewed in https://reviews.freebsd.org/D14599.
2018-12-28 13:34:33 +01:00
Anton Lindqvist
fc6ae81a34 executor: KIOENABLE accepts a mode argument on OpenBSD 2018-12-28 08:25:37 +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
Anton Lindqvist
43cf01dd41 executor: include sys/kcov.h on OpenBSD
Since we no longer cross-compile, there's no need to repeat the defines.
2018-12-27 11:06:03 +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
82c9e6774f executor: fix max number of syscall args
De-hardcode max number (wrong) of syscall args.
2018-12-26 21:52:50 +01:00
Dmitry Vyukov
586a19e7ec executor: create more net devices on linux 2018-12-26 21:44:05 +01:00
Dmitry Vyukov
c87e9eb9bd dashboard/config: enable HSR and NUMA_EMU 2018-12-26 18:24:53 +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
8a41a0ad8e sys/linux: add network drop monitor support 2018-12-24 18:56:08 +01:00
Dmitry Vyukov
17c23ac162 sys/linux: add udmabuf descriptions 2018-12-24 18:56:08 +01:00
Dmitry Vyukov
a961943f02 sys/linux: add basic AF_CAIF descriptions 2018-12-24 18:56:07 +01:00
Dmitry Vyukov
57541e29d9 sys/linux: add basic X25 descriptions 2018-12-24 18:56:06 +01:00
Dmitry Vyukov
309bb18442 dashboard/config: moar networking configs
Add more x25 drivers, wlan, slip, caif and other stuff that I don't understand,
but syzkaller can potentially reach.
2018-12-24 18:56:06 +01:00
Dmitry Vyukov
dd61e58d94 sys/linux: extend AX25/ROSE/NETROM descriptions 2018-12-24 18:56:06 +01:00
Shankara Pailoor
dd2986b43b tools/syz-trace2syz/parser: parse strace bitsets
Strace decodes bitsets like fd_set or sa_mask into the following structure: [a b c d e].
Before we couldn't parse these structures, but now parse them into the Group IR Type
2018-12-24 10:05:32 +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
b025ab82d2 dashboard/config: enable more net configs
Enable some more net configs that we can potentially reach.
Update to latest kernel.
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