aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ipc
Commit message (Collapse)AuthorAgeFilesLines
...
* executor: collect coverage from unfinished syscallsDmitry Vyukov2018-07-291-18/+33
| | | | | | | | Write coverage from unfinished syscalls. Also detect when a syscall was blocked during execution, even if it finished. Helpful for fallback coverage. Fixes #580
* executor: overhaulDmitry Vyukov2018-07-241-1/+18
| | | | | | | | | | | | | | | | | Make as much code as possible shared between all OSes. In particular main is now common across all OSes. Make more code shared between executor and csource (in particular, loop function and threaded execution logic). Also make loop and threaded logic shared across all OSes. Make more posix/unix code shared across OSes (e.g. signal handling, pthread creation, etc). Plus other changes along similar lines. Also support test OS in executor (based on portable posix) and add 4 arches that cover all execution modes (fork server/no fork server, shmem/no shmem). This change paves way for testing of executor code and allows to preserve consistency across OSes and executor/csource.
* pkg/host: add "network devices" featureDmitry Vyukov2018-07-131-2/+4
| | | | | | Linux executor sets up some network devices for testing, detect when that's supported on the machine and don't do it if it's not supported.
* vm/vmimpl: factor out common code for ssh args and waiting for sshDmitry Vyukov2018-07-061-1/+1
| | | | Move common code from 4 vm implementations to vmimpl.
* pkg/ipc: add rate limiting for akarosDmitry Vyukov2018-07-051-0/+10
|
* pkg/ipc: create default config based on targetDmitry Vyukov2018-07-052-14/+3
| | | | | Pass actual target to DefaultConfig, that's what we really want, not the stray ipc flag.
* pkg/ipc: don't consider hang as failureDmitry Vyukov2018-06-301-3/+3
|
* prog: add stronger fallback signalDmitry Vyukov2018-06-291-7/+8
| | | | | Also mixin resource constructors and some signature of flags values for successful calls into fallback coverage.
* pkg/ipc: suppress gometalinter warningsDmitry Vyukov2018-06-291-1/+4
|
* syz-manager: implement fallback coverage reportDmitry Vyukov2018-06-291-1/+2
|
* executor, pkg/ipc: support output over pipesDmitry Vyukov2018-06-291-60/+65
|
* pkg/ipc: cleanup binary copyDmitry Vyukov2018-06-291-6/+11
|
* pkg/ipc: fix cleanup in testDmitry Vyukov2018-06-291-8/+10
| | | | | | | Currently we first send on errs and then close env. As the result process can exit before env.Close finishes, which will leave garbage behind. Close env before sending on errs.
* pkg/ipc: use absolute path to start subprocessDmitry Vyukov2018-06-291-0/+1
| | | | fuchsia mishandles relative paths.
* pkg/ipc: add fallback signal only if normal signal is not enabledDmitry Vyukov2018-06-231-1/+1
| | | | | | It's possible to get no signal from normal coverage due to dedup, in that case we don't want to add fallback coverage because it can lead to corpus bloat.
* executor: rework fallback coverageDmitry Vyukov2018-06-221-2/+20
| | | | | | | | | | We have fallback coverage implmentation for freebsd. 1. It's broken after some recent changes. 2. We need it for fuchsia, windows, akaros, linux too. 3. It's painful to work with C code. Move fallback coverage to ipc package, fix it and provide for all OSes.
* all: fix gometalinter warningsDmitry Vyukov2018-06-121-3/+0
|
* pkg/host: rework host feature detection/setupDmitry Vyukov2018-06-121-8/+0
| | | | | | | | | | Currently host feature detection/setup code is spread across platform-independent fuzzer code, pkg/host, pkg/ipc and executor. Move this all into pkg/host and show readable info about features on manager start. Fixes #46
* pkg/csource: allow to build source fom memoryDmitry Vyukov2018-06-061-7/+3
| | | | | | In most cases we have source in memory, so provide a function to build right from memory without creating temp files.
* Makefile, sys/targets: move all native compilation logic to sys/targetsDmitry Vyukov2018-06-061-1/+1
| | | | | | | | | | | | | | | We currently have native cross-compilation logic duplicated in Makefile and in sys/targets. Some pieces are missed in one place, some are in another. Only pkg/csource knows how to check for -static support. Move all CC/CFLAGS logic to sys/targets and pull results in Makefile. This should make Makefile work on distros that have broken x86_64-linux-gnu-gcc, now we will use just gcc. And this removes the need to define NOSTATIC, as it's always auto-detected. This also paves the way for making pkg/csource work on OSes other than Linux.
* gometalinter: enable line length checkingDmitry Vyukov2018-05-041-5/+9
| | | | | | | 120 columns looks like a reasonable limit and requires few changes to existing code. Update #538
* pkg/ipc: fix data race on config.TimeoutDmitry Vyukov2018-04-232-24/+85
|
* pkg/ipc: disable coverage collection by defaultDmitry Vyukov2018-04-061-1/+1
| | | | | | | | | | | | | syz-manager always passes explicit value for the flag. syz-stress does not need coverage. The only real user is syz-execprog. syz-execprog already forces coverage with -coverfile is given. Coverage is harmful for external users trying to reproduce reported bugs. For the remaining cases of syzkaller developers running syz-execprog on KCOV-enabled kernel, the flag can be given manually if really needed. Fixes #554
* pkg/ipc: test only on simple progDmitry Vyukov2018-03-201-48/+20
| | | | | | Don't use random programs for testing. Sometimes they lead to flakes like: opendir(./1/file0) failed (errno 13)
* all: fix gometalinter warningsDmitry Vyukov2018-03-082-17/+4
| | | | Fix typos, non-canonical code, remove dead code, etc.
* sys/linux: fix mmap call argsDmitry Vyukov2018-02-201-7/+15
| | | | Also add a test for this.
* 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.