aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
Commit message (Collapse)AuthorAgeFilesLines
* pkg/csource: add function to parse serialized optionsDmitry Vyukov2017-11-174-105/+215
| | | | | Also move options and options tests into a separate file, add serialization function.
* pkg/osutil: don't leace runaway processesDmitry Vyukov2017-11-161-4/+5
| | | | | | When manager is stopped there are sometimes runaway qemu processes still running. Set PDEATHSIG for all subprocesses. We never need child processes outliving parents.
* 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.
* csource: Fix sed(1) invocationzoulasc2017-11-061-4/+4
| | | | | | | | There is no need to specify '-' as the filename for sed(1): - The default behavior is to read stdin - It was not done in all places - It breaks on NetBSD sed(1) (although I am tempted to fix it now :-) and it does not work
* pkg/csource: add freebsd/netbsd supportDmitry Vyukov2017-10-264-0/+652
|
* executor: fix build breakages due to doexitDmitry Vyukov2017-10-192-6/+21
| | | | | Some standard libraries contain "using ::exit;", which breaks with the current redefinition of exit.
* executor: fix akaros nonfailing modeDmitry Vyukov2017-10-161-1/+9
|
* executor, pkg/ipc: unify ipc protocol between linux and other OSesDmitry Vyukov2017-10-163-12/+17
| | | | | | | | | | | | | | | | | 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/csource: support akarosDmitry Vyukov2017-10-164-123/+548
|
* executor: write debug output to stderrDmitry Vyukov2017-10-161-2/+2
| | | | | | We print all other output to stderr, write debug output to stderr as well. This does not matter for the main use case of running syz-execprog -debug, but can is helpful if we want to communicate with syz-executor via stdin/stdout.
* pkg/ipc: don't send program padding to executorDmitry Vyukov2017-10-121-1/+1
| | | | | | 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.
* executor: include missing headerDmitry Vyukov2017-10-101-3/+6
| | | | writev requires <sys/uio.h>. Include it.
* all: basic freebsd supportDmitry Vyukov2017-10-021-0/+3
| | | | For now we just make Go part build for freebsd.
* executor: support fragmentation in syz_emit_ethernetDmitry Vyukov2017-10-021-16/+67
| | | | | | 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: fix execution of windows syscallsDmitry Vyukov2017-09-271-1/+6
| | | | | First, they must be called with stdcall convention. Second, wrap them in __try/__except because they can crash.
* executor, sys/windows: initial windows supportDmitry Vyukov2017-09-252-56/+63
|
* pkg/csource: disable linux/386 testsDmitry Vyukov2017-09-221-0/+5
| | | | Another attempt to fix travis build.
* all: more assorted fuchsia supportDmitry Vyukov2017-09-223-148/+153
|
* sys/targets: move targets from sys packageDmitry Vyukov2017-09-151-3/+3
| | | | | | | This breaks circular dependency between: sysgen -> sys/linux -> sys -> sysgen With this circular dependency it is very difficult to update format of generated descriptions because sysgen does not build.
* pkg/csource: support archs other than x86_64Dmitry Vyukov2017-09-152-24/+68
|
* prog: remove default target and all global stateDmitry Vyukov2017-09-152-15/+15
| | | | | | 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-052-2/+3
| | | | | | | | | | | 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
* sys: rename Call to SyscallDmitry Vyukov2017-09-051-1/+1
| | | | | In preparation for moving sys types to prog to avoid confusion between sys.Call and prog.Call.
* pkg/compiler: check and generate typesDmitry Vyukov2017-09-021-5/+6
| | | | | | Move most of the logic from sysgen to pkg/compiler. Update #217
* sys, prog: switch values to to uint64Dmitry Vyukov2017-08-191-5/+5
| | | | | | | | | | We currently use uintptr for all values. This won't work for 32-bit archs. Moreover in some cases we use uintptr but assume that it is always 64-bits (e.g. in encodingexec). Switch everything to uint64. Update #324
* pkg/repro: fix invalid options minimizationDmitry Vyukov2017-08-092-6/+15
| | | | | | | | | | | Repro can generate Sandbox="namespace"/UseTmpDir=false. This combination is broken for two reasons: - on second and subsequent executions of the program, it fails to create syz-tmp dir - with Procs>1, it fails right away, because all procs try to create syz-tmp dir Don't generate such combination.
* pkg/csource, pkg/repro: filter out invalid options combinationsDmitry Vyukov2017-08-092-2/+25
| | | | | | | | | We currently have 2 invalid options combinations: - collide without threads - procs>1 without repeat They are invalid in the sense that result of csource.Write is the same for them. Filter out these combinations. This cuts csource testing time in half and reduces repro minimization time.
* executor: sandbox with RLIMIT_MEMLOCKDmitry Vyukov2017-08-081-0/+2
| | | | | | | Locking memory is a reasonably legitimate local DoS vector. E.g. bpf maps allow allocation of large chunks of kernel memory without RLIMIT_MEMLOCK, which leads to hangups. Set RLIMIT_MEMLOCK=8MB in executor.
* pkg/csource: make all usleeps randomAndrey Konovalov2017-07-242-4/+2
| | | | | | We can't know the exact values of those sleeps in advance, they can be different for different bugs. Making them random increases the chance that the C repro executes with the right timings at some point.
* pkg/csource: reformatDmitry Vyukov2017-07-051-1/+1
|
* pkg/csourse: don't generate __NR_X defines for old syscallsAndrey Konovalov2017-07-051-3/+7
|
* all: use consistent file permissionsDmitry Vyukov2017-07-031-2/+2
| | | | | | | | | | | | | | | | 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/csource: regenerateDmitry Vyukov2017-06-261-0/+2
|
* pkg/csource: move from csourceDmitry Vyukov2017-06-173-0/+2646