aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ipc
Commit message (Collapse)AuthorAgeFilesLines
* pkg/ipc: always prepend handshake errors with executor pidDmitry Vyukov2018-01-061-6/+4
| | | | Helps to understand what program caused it.
* pkg/csource: fix handling of proc typesDmitry Vyukov2017-12-221-1/+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
* syz-fuzzer: refactorDmitry Vyukov2017-12-181-8/+0
| | | | | | | | | | | syz-fuzzer organically grew from a small nice main function into a huge single-file monster with tons of global state. Start refactoring it into something more managable. This change separates 2 things: 1. Proc: a single fuzzing process (ipc.Env wrapper). 2. WorkQueue: holds global non-fuzzing work items. More work needed, but this is good first step.
* pkg/ipc: make threaded/collide per-program optionsDmitry Vyukov2017-12-172-53/+71
| | | | | | | Currently threaded/collide are global environment flags. It can be useful to turn off collider during some executions (minimization, triage, etc). Make them per-program options.
* syz-ci: test images before using themDmitry Vyukov2017-11-302-3/+5
| | | | | | | Boot and minimally test images before declaring them as good and switching to using them. If image build/boot/test fails, upload report about this to dashboard.
* pkg/osutil: don't leace runaway processesDmitry Vyukov2017-11-161-1/+1
| | | | | | When manager is stopped there are sometimes runaway qemu processes still running. Set PDEATHSIG for all subprocesses. We never need child processes outliving parents.
* pkg/ipc: fix reading comp hintsDmitry Vyukov2017-10-231-15/+13
| | | | if/else branches are intermixed
* pkg/ipc: move fallback coverage into executorDmitry Vyukov2017-10-181-14/+0
| | | | | It seems to explode linux corpus. So make it freebsd-specific.
* executor: use forkserver for freebsdDmitry Vyukov2017-10-181-0/+14
| | | | | | | Use forkserver and shmem for freebsd. This greatly improves speed. Also introduce fallback coverage signal based on unique (syscall+errno) pairs.
* executor, pkg/ipc: unify ipc protocol between linux and other OSesDmitry Vyukov2017-10-164-773/+752
| | | | | | | | | | | | | | | | | 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.
* pkg/ipc: don't send program padding to executorDmitry Vyukov2017-10-122-3/+4
| | | | | | Currently we always send 2MB of data to executor in ipc_simple.go. Send only what's consumed by the program, and don't send the trailing zeros. Serialized programs usually take only few KBs.
* pkg/ipc, pkg/osutil: remove filepath.Abs fuchsia workaroundsDmitry Vyukov2017-10-121-13/+10
| | | | | This claimed to be fixed: https://fuchsia.atlassian.net/browse/DNO-158
* pkg/ipc: extend error when fail to start executorDmitry Vyukov2017-10-101-1/+1
| | | | | | We currently return raw error, so sometimes it's hard to tell even what call produced the error (e.g. just "invalid argument"). Extend the error so that it's clear that it comes from cmd.Start.
* all: basic freebsd supportDmitry Vyukov2017-10-021-1/+1
| | | | For now we just make Go part build for freebsd.
* pkg/ipc: fix windowsDmitry Vyukov2017-09-271-1/+4
| | | | | Abs does not work on fuchsia only, use it on windows. Also maintain stats.
* pkg/ipc: windows portDmitry Vyukov2017-09-251-1/+1
|
* all: more assorted fuchsia supportDmitry Vyukov2017-09-223-16/+93
|
* all: initial support for fuchsiaDmitry Vyukov2017-09-203-644/+683
| | | | | | Nothing works, but builds. Update #191
* executor: split source per-OSDmitry Vyukov2017-09-201-1/+3
| | | | Update #191
* pkg/csource: support archs other than x86_64Dmitry Vyukov2017-09-151-8/+13
|
* prog: remove default target and all global stateDmitry Vyukov2017-09-151-5/+6
| | | | | | Now each prog function accepts the desired target explicitly. No global, implicit state involved. This is much cleaner and allows cross-OS/arch testing, etc.
* syz-manager/mgrconfig: explicitly specify target in configDmitry Vyukov2017-09-151-0/+5
| | | | | Add target config parameter (e.g. linux/amd64) which controls target OS/arch. No more explicit assumptions about target.
* prog, sys: move types to progDmitry Vyukov2017-09-051-0/+1
| | | | | | | | | | | Large overhaul moves syscalls and arg types from sys to prog. Sys package now depends on prog and contains only generated descriptions of syscalls. Introduce prog.Target type that encapsulates all targer properties, like syscall list, ptr/page size, etc. Also moves OS-dependent pieces like mmap call generation from prog to sys. Update #191
* executor, ipc: modify the IO between KCOV<->executor<->fuzzerVictor Chibotaru2017-08-301-6/+89
| | | | | Now executor is able to read comparisons data from KCOV and write them to fuzzer.
* executor, fuzzer: change the way Syzkaller opens the KCOV deviceVictor Chibotaru2017-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have implemented a new version of KCOV, which is able to dump comparison operands' data, obtained from Clang's instrumentation hooks __sanitizer_cov_trace_cmp[1248], __sanitizer_cov_trace_const_cmp[1248] and __sanitizer_cov_trace_switch. Current KCOV implementation can work in two modes: "Dump only the PCs" or "Dump only comparisons' data". Mode selection is done by the following series of calls: fd = open(KCOV_PATH, ...); // works as previous ioctl(fd, KCOV_INIT_TRACE, ...); // works as previous mmap(fd, ...); // works as previous ioctl(fd, KCOV_ENABLE, mode); // mode = KCOV_MODE_TRACE_CMP or mode = KCOV_MODE_TRACE_PC Note that this new interface is backwards compatible, as old KCOV devices will just return -EINVAL for the last ioctl. This way we can distinguish if the KCOV device is able to dump the comparisons. Main changes in this commit: 1. Fuzzer now checks at startup which type (new/old) of KCOV device is running. 2. Executor now receives an additional flag, which indicates if executor should read the comparisons data from KCOV. The flag works on per-call basis, so executor can collect PCs or Comps for each individual syscall.
* all: use consistent file permissionsDmitry Vyukov2017-07-032-7/+7
| | | | | | | | | | | | | | | | 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.
* pkg/ipc: move from ipcDmitry Vyukov2017-06-173-0/+863