aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_linux.h
Commit message (Collapse)AuthorAgeFilesLines
* sys/linux: more selinux descriptionsDmitry Vyukov2018-01-181-1/+6
|
* executor: fix tun/device setup for sandbox=namespaceDmitry Vyukov2018-01-151-8/+33
| | | | | | | | For sandbox=namespace we first create network devices and then do CLONE_NEWNS, which brings us into a new namespace which actually does not have any of these devices. Tun mostly worked, because we hold fd to the tun device. However, even for tun we could not see the "syz0" device.
* executor: setup network devicesDmitry Vyukov2018-01-131-18/+55
| | | | | | We test in a new network namespace, which does not have any devices set up (even lo). Create/up as many devices as possible. Give them some addresses and use these addresses in descriptions.
* executor: introduce uint64/32/16/8 typesDmitry Vyukov2017-12-271-32/+32
| | | | | | | | | | | | | | | The "define uint64_t unsigned long long" were too good to work. With a different toolchain I am getting: cstdint:69:11: error: expected unqualified-id using ::uint64_t; ^ executor/common.h:34:18: note: expanded from macro 'uint64_t' Do it the proper way: introduce uint64/32/16/8 types and use them. pkg/csource then does s/uint64/uint64_t/ to not clutter code with additional typedefs.
* executor: fix another format bugDmitry Vyukov2017-12-271-1/+1
| | | | Detected only by clang.
* executor: check format stringsDmitry Vyukov2017-12-271-3/+3
| | | | | | | | | | | | | | | | | | | I see a crash which says: #0: too much cover 0 (errno 0) while the code is: uint64_t n = ...; if (n >= kCoverSize) fail("#%d: too much cover %u", th->id, n); It seems that the high part of n is set, but we don't see it. Add printf format attribute to fail and friends and fix all similar cases. Caught a bunch of similar cases and a missing argument in: exitf("opendir(%s) failed due to NOFILE, exiting");
* pkg/csource: mimic the way syscalls are scheduled in executorDmitry Vyukov2017-12-221-0/+64
| | | | | | | | Currently csource uses completely different, simpler way of scheduling syscalls onto threads (thread per call with random sleeps). Mimic the way calls are scheduled in executor. Fixes #312
* executor: remove dead codeDmitry Vyukov2017-12-221-2/+0
| | | | doexit already contains an infinite loop.
* pkg/csource: fix handling of proc typesDmitry Vyukov2017-12-221-0/+1
| | | | | | | | | | Generated program always uses pid=0 even when there are multiple processes. Make each process use own pid. Unfortunately required to do quite significant changes to prog, because the current format only supported fixed pid. Fixes #490
* sys: move test syscalls to a separate targetDmitry Vyukov2017-12-171-8/+0
| | | | | | We have them in linux solely for historical reasons. Fixes #462
* executor: fix buildDmitry Vyukov2017-12-061-4/+4
| | | | | | exitf function was not defined with some combinations of options in csource. Fix defines and switch exitf back to fail, fail already checks ENOMEM/EAGAIN, so there is no reason to use exitf in this particular case.
* executor: unshare PID namespace even for sandbox=noneDmitry Vyukov2017-12-051-5/+26
| | | | | | | | Unshare as much as we can for all sandboxing modes. This fixes "kernel panic: Attempted to kill init!" crashes under sandbox=none. And should just generally improve reproducibility, e.g. if we unshare SYSVSEM fuzzer won't collide with any existing semaphores.
* executor: treat fail-nth errors as non-fatalDmitry Vyukov2017-12-051-4/+7
| | | | | We see occasional ENOENT/EACCES errors returned. It seems that fuzzer somehow gets its hands to it.
* sys/linux: open files from /procDmitry Vyukov2017-11-271-1/+23
|
* executor: use /proc/thread-self/fail-nth instead of /proc/self/task/%d/fail-nthDmitry Vyukov2017-11-271-7/+6
| | | | Makes code slightly simpler.
* executor: proceed even if /dev/net/tun is not availableAndrey Konovalov2017-11-081-2/+12
| | | | | | | | | 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.
* executor: fix build breakages due to doexitDmitry Vyukov2017-10-191-6/+0
| | | | | Some standard libraries contain "using ::exit;", which breaks with the current redefinition of exit.
* executor, pkg/ipc: unify ipc protocol between linux and other OSesDmitry Vyukov2017-10-161-1/+0
| | | | | | | | | | | | | | | | | 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.
* executor: include missing headerDmitry Vyukov2017-10-101-0/+1
| | | | writev requires <sys/uio.h>. Include it.
* executor: set own PATH when starting subprocessesDmitry Vyukov2017-10-101-3/+8
| | | | | | Executor process does not have any env, including PATH. On some distributions, system/shell adds a minimal PATH, on some it does not. Set own standard PATH to make it work across distributions.
* executor: support fragmentation in syz_emit_ethernetDmitry Vyukov2017-10-021-19/+79
| | | | | | A recent linux commit "tun: enable napi_gro_frags() for TUN/TAP driver" added support for fragmentation when emitting packets via tun. Support this feature in syz_emit_ethernet.
* executor, sys/windows: initial windows supportDmitry Vyukov2017-09-251-0/+65
|
* all: more assorted fuchsia supportDmitry Vyukov2017-09-221-0/+877