aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_linux.cc
Commit message (Collapse)AuthorAgeFilesLines
* executor: overhaulDmitry Vyukov2018-07-241-258/+0
| | | | | | | | | | | | | | | | | 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/csource: support fuchsiaDmitry Vyukov2018-06-291-11/+4
| | | | Lots of assorted heavylifting to support csource on fuchsia.
* executor: extend error on output overflowDmitry Vyukov2018-06-221-1/+2
|
* executor: rework fallback coverageDmitry Vyukov2018-06-221-13/+2
| | | | | | | | | | 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.
* executor: make syscall table and number constantDmitry Vyukov2018-06-071-3/+3
| | | | | | | | | We see some crashes that suggest corruption of the syscall number: invalid command number 1296 (errno 11) invalid command number 107 (errno 110) Make the table and the number constant to prevent corruption.
* executor: revert protection of kcov regionDmitry Vyukov2018-05-151-7/+3
| | | | | Turns out it's protection of kcov region that causes coverage drop. Revert it and re-enable coverage filtering.
* executor: revert coverage filteringDmitry Vyukov2018-05-141-1/+3
| | | | | This causes very significant drop in corpus size. Needs additional debugging. Revert for now.
* executor: protect most of kcov regionDmitry Vyukov2018-05-141-2/+4
| | | | | We only write to the first page of kcov region. Protect the rest from the fuzzer.
* executor: filter out invalid PCs on linux/x86_64Dmitry Vyukov2018-05-141-0/+15
| | | | | Fuzzer manages to corrupt output region and write random coverage again and again. Do a sanity range check on coverage PCs to filter out invalid ones.
* executor: randomize output region addrDmitry Vyukov2018-05-141-7/+7
| | | | | Fuzzer manages to corrupt output region and write random coverage again and again. Randomize output region addr to make it harder.
* executor: support cover on 32-bit kernelsDmitry Vyukov2018-04-271-14/+40
| | | | Detect kernel bitness and properly extract coverage on 32-bit kernels.
* executor: support 32-bit kernelsDmitry Vyukov2018-04-161-12/+12
| | | | | There is no autodetection yet, but at least bitness is encapsulated in cover_t type.
* sys/linux: add support for mounting filesystem imagesDmitry Vyukov2018-03-301-0/+5
|
* sys/linux: add cgroup descriptionsDmitry Vyukov2018-03-251-97/+0
|
* executor: simplify initialize_tunDmitry Vyukov2018-02-261-3/+3
| | | | Remove executor_pid, enable_tun and setup_tun.
* prog: rework address allocationDmitry Vyukov2018-02-191-1/+5
| | | | | | | | | | | | 1. mmap all memory always, without explicit mmap calls in the program. This makes lots of things much easier and removes lots of code. Makes mmap not a special syscall and allows to fuzz without mmap enabled. 2. Change address assignment algorithm. Current algorithm allocates unmapped addresses too frequently and allows collisions between arguments of a single syscall. The new algorithm analyzes actual allocations in the program and places new arguments at unused locations.
* sys/linux: extend netfilter descriptionsDmitry Vyukov2018-01-271-1/+3
|
* executor: introduce uint64/32/16/8 typesDmitry Vyukov2017-12-271-18/+19
| | | | | | | | | | | | | | | 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 reply status on loop killsDmitry Vyukov2017-12-271-1/+2
| | | | | | | We use exitf on loop failures, anbd exitf is retry-able. However, we use different status when replying to ipc, and that different status is what ipc actually uses. Use kRetryStatus status in case on unexpected loop failures.
* executor: check format stringsDmitry Vyukov2017-12-271-2/+2
| | | | | | | | | | | | | | | | | | | 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-1/+0
| | | | | | | | 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
* sys/syz-extract: fix mmap on armDmitry Vyukov2017-11-231-10/+0
| | | | | | | __NR_mmap is missing on arm entirely, so we disable mmap during generate. Patch mmap to mmap2 right in syz-extract, so that mmap is never missing.
* executor: fixup previous commitDmitry Vyukov2017-11-221-223/+223
|
* executor: move arm syscall fixup to syz-extractDmitry Vyukov2017-11-221-243/+222
|
* executor: Modified executor_linux.cc to support ARM32 architectureAtul Prakash2017-11-221-2/+25
| | | | | | executor: changed kOutputDataAddr so that it works on 32-bit kernels executor: simplified ifdefs for arm in executor_linux.cc executor: removed empty lines that were accidentally added.
* executor: prevent executor from messing with output regionDmitry Vyukov2017-10-231-3/+36
| | | | | | | | When comparisons are enabled fuzzer somehow manages to discover the output region and corrupt it. It seems to fetch the address from some memory operations (mmap/munmap). Don't leak the output region address.
* executor: improvements for akarosDmitry Vyukov2017-10-171-1/+1
| | | | | | | 1. remove workaround for pthread attrs (was fixed in akaros) 2. remove workaround for dup2 (was fixed in akaros) 3. check that we receive a program 4. implement timeout for test processes
* executor, pkg/ipc: unify ipc protocol between linux and other OSesDmitry Vyukov2017-10-161-47/+13
| | | | | | | | | | | | | | | | | 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, sys/windows: initial windows supportDmitry Vyukov2017-09-251-50/+3
|
* all: more assorted fuchsia supportDmitry Vyukov2017-09-221-677/+51
|
* all: initial support for fuchsiaDmitry Vyukov2017-09-201-1/+1
| | | | | | Nothing works, but builds. Update #191
* executor: split source per-OSDmitry Vyukov2017-09-201-0/+1001
Update #191