aboutsummaryrefslogtreecommitdiffstats
path: root/executor
Commit message (Collapse)AuthorAgeFilesLines
* sys/linux: extend xattr descriptionsDmitry Vyukov2018-09-022-5/+95
| | | | Update #533
* executor: OpenBSD does not allow write and exec mappings by defaultAnton Lindqvist2018-08-311-1/+8
| | | | | | | | | | Since the OpenBSD target does not make use of syz_execute_func yet, just drop PROT_EXEC for now. Supporting write and exec would require one to edit /etc/fstab during installation. Regression introduced in commit a4718693 ("sys/linux: add syz_execute_func").
* sys/linux: add syz_execute_funcDmitry Vyukov2018-08-307-22/+47
| | | | | | The function executes random code. Update #310
* sys/linux: add nbd descriptionsDmitry Vyukov2018-08-302-5/+90
| | | | Update #533
* sys/linux: generate better block device names for mountDmitry Vyukov2018-08-301-5/+5
|
* sys/fuchsia: describe method response types & handles; add support for unionDokyung Song2018-08-292-36/+36
| | | | | | | | * create a response handle structure for each FIDL method * generate zx_channel_write for requests having no response * generate zx_channel_read for events (no request but just response) * translate FIDL union types to syzkaller union types (see fuchsia_io_ObjectInfoHandles)
* sys/linux: add ext4 ioctls and overlayfsDmitry Vyukov2018-08-292-10/+115
| | | | Update #533
* Add mandatory OpenBSD bits (#689)Anton Lindqvist2018-08-287-6/+312
| | | | | | | | | | | | | | | | | | all: add openbsd support squash of the following commits: * openbsd: add mandatory bits * report: add OpenBSD support * executor: skip building kvm on OpenBSD * executor: add OpenBSD support Linking against libutil is necessary due to usage of openpty(3). * executor: fix typo in fail() message * fixup! report: add OpenBSD support * fixup! openbsd: add mandatory bits * fixup! openbsd: add mandatory bits * fixup! openbsd: add mandatory bits * fixup! report: add OpenBSD support * gometalinter: skip sys/openbsd
* sys/fuchsia: description for fuchsia.io FIDL interfacesDokyung Song2018-08-272-2/+116
|
* sys/linux: fix kvm_ioeventfd layoutDmitry Vyukov2018-08-261-5/+5
|
* sys/linux: add few assorted new flags/ioctlsDmitry Vyukov2018-08-262-5/+9
|
* sys/linux: treat cuse as fuseDmitry Vyukov2018-08-262-5/+10
| | | | | | It's mostly fuse. Also regenerate consts on latest kernel.
* sys/linux: add IOCB_CMD_POLLDmitry Vyukov2018-08-261-5/+5
|
* sys/linux: add userio descriptionsDmitry Vyukov2018-08-262-5/+20
| | | | Update #533
* executor: update special fuchsia syscallsDmitry Vyukov2018-08-241-1/+3
| | | | | zx_clock_get_monotonic was added, zx_debuglog_read was renamed (or we forgot to add it earlier).
* sys/fuchsia: Remove read_status from zx_channel_call args, and reflect ↵Dokyung Song2018-08-241-2/+2
| | | | zx_time_t type change (unsigned -> signed)
* prog: don't add fallback signal after seccompDmitry Vyukov2018-08-192-1/+4
| | | | | seccomp filter can produce arbitrary errno values for subsequent syscalls. Don't trust anything afterwards.
* executor: fix gcc warnings in fuchsia generated codeDmitry Vyukov2018-08-192-20/+27
| | | | | | gcc complains about function declarations not being prototypes, signed/unsigned cast mismatch and casts between incompatible functions. Fix them.
* sys/fuchsia: semi-automatically generated FIDL launcher descriptionDokyung Song2018-08-172-2/+12
|
* sys/linux: add uinput supportDmitry Vyukov2018-08-152-5/+120
|
* sys/linux: add uhid supportDmitry Vyukov2018-08-152-5/+45
|
* sys/linux: fix invalid cdrom descriptionDmitry Vyukov2018-08-101-5/+5
|
* executor: fix FS_XFLAG_IMMUTABLE for 32-bit modeDmitry Vyukov2018-08-091-15/+5
| | | | FS_IOC_FSSETXATTR is not supported in compat mode, use FS_IOC_SETFLAGS instead.
* executor: fix cgroupsDmitry Vyukov2018-08-092-5/+4
| | | | | | | 1. Create per-proc cgroup in executor. 2. Setup cgroups after chdir into test dir (it assumes relative paths against test dir). 3. Add test.
* executor: mount binfmt_mistDmitry Vyukov2018-08-093-7/+11
| | | | | | We forgot to mount binfmt_misc. Mount it. Add a test. Increase per-call timeout, otherwise last execve timesout. Fix csource waiting for call completion at the end of program.
* executor: clean up immutable dirsDmitry Vyukov2018-08-091-0/+11
| | | | | | Turns out dirs can be immutable too. Update #650
* executor: remove unnecessary hooks on fuchsiaDmitry Vyukov2018-08-091-5/+0
| | | | These are not needed now.
* sys/fuchsia: add syscall description for binding channels to LauncherDokyung Song2018-08-083-2/+9
|
* executor: manually define struct fsxattrDmitry Vyukov2018-08-081-1/+13
| | | | | | | | | | | | | | | | | | It should be in <linux/fs.h> but is not there on some distros/arches as expected. Travis build fails with: <stdin>: In function ‘remove_dir’: <stdin>:152:13: error: variable ‘attr’ has initializer but incomplete type <stdin>:152:13: error: excess elements in struct initializer [-Werror] <stdin>:152:13: error: (near initialization for ‘attr’) [-Werror] <stdin>:152:21: error: storage size of ‘attr’ isn’t known <stdin>:153:20: error: ‘FS_IOC_FSSETXATTR’ undeclared (first use in this function) <stdin>:153:20: note: each undeclared identifier is reported only once for each function it appears in <stdin>:152:21: error: unused variable ‘attr’ [-Werror=unused-variable] cc1: all warnings being treated as errors https://travis-ci.org/google/syzkaller/jobs/413574080
* executor: clean up immutable filesDmitry Vyukov2018-08-081-0/+12
| | | | Fixes #650
* executor: remap cover fd's to higher valuesDmitry Vyukov2018-08-083-8/+18
| | | | | | Remap cover fd's to 24x range to prevent interference with fd's used during fuzzing and also to make fd number consistent with/without cover enabled.
* executor: don't checkpoint/reset net namespace with setuid sandboxDmitry Vyukov2018-08-081-0/+9
| | | | | | After setuid the process won't have rights to reset net namespace, but it should not be able to change it during fuzzing too. So just skip that part.
* executor: checkpoint net namespace in the right namespaceDan Austin2018-08-081-5/+4
| | | | | | | With checkpoint_net_namespace moved to setup_common, and Android fuzzing session terminates prematurely due to ipv4_tables not being initialized at this time. Moving the call back to loop fixes this behavior.
* executor: check write return valueDmitry Vyukov2018-08-052-2/+10
| | | | | | | | gcc complains: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result] Also fix includes.
* executor: abort fuse connectionDmitry Vyukov2018-08-042-6/+72
| | | | | | | If the test process is not dying after 100ms, abort all fuse connections in the system. This gets rid at least of simple fuse deadlocks, let's see how well this works in all cases.
* sys/test: add more testsDmitry Vyukov2018-08-033-4/+47
| | | | | | | | | | | | | | Add syz_errno syscall which sets errno to the argument, and add a test with different errno values. This mostly tests the testing infrastructure itself. Add syz_compare syscall which compare two blobs, this can be used for testing of argument memory layout. Implement syz_mmap and fix Makefile to allow building syz-execprog for test OS. Useful for debugging. Update #603
* sys/fuchsia: zx_log_* got replaced by zx_debuglog_*Dokyung Song2018-08-032-8/+2
|
* sys/akaros: remove /dev/consDmitry Vyukov2018-08-022-3/+1
| | | | Presumably it causes corrupted console output.
* executor: extend logging in netfilter codeDmitry Vyukov2018-08-021-32/+47
| | | | | We see some failures there, extend logging so that it's least possible to understand what exactly call has failed.
* Makefile: don't compile all targets into target binariesDmitry Vyukov2018-08-021-15/+15
| | | | | | | | | | Currently target binaries contain support for all OS/arch combinations. However, obviously a fuchsia target binary won't test windows. For target binaries we need support only for a single target (with the exception of 386/arm target in amd64/arm64 binaries). So compile in only _the_ target into target binaries. This reduces akaros/amd64 fuzzer binary from 33 to 7 MB and execprog from 28 to 2 MB.
* executor: make current_time_ms/sleep_msDmitry Vyukov2018-07-302-7/+6
| | | | | Fix conditions for when current_time_ms/sleep_ms are used and make them static.
* executor: collect coverage from unfinished syscallsDmitry Vyukov2018-07-291-117/+158
| | | | | | | | 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: disable clang-format for some partsDmitry Vyukov2018-07-271-8/+8
| | | | | clang-format badly mishandles this part, moreover different versions mishandle it differently.
* pkg/csource: add option to trace syscall resultsDmitry Vyukov2018-07-271-0/+11
| | | | This will be needed for testing of generated programs.
* pkg/csource: tidy generated codeDmitry Vyukov2018-07-278-33/+143
| | | | | | | | | | | 1. Remove unnecessary includes. 2. Remove thunk function in threaded mode. 3. Inline syscalls into main for the simplest case. 4. Define main in common.h rather than form with printfs. 5. Fix generation for repeat mode (we had 2 infinite loops: in main and in loop). 6. Remove unused functions (setup/reset_loop, setup/reset_test, sandbox_namespace, etc).
* executor: simplify event_timedwaitDmitry Vyukov2018-07-272-30/+19
| | | | | | We always have current_time_ms in event_timedwait so use it instead of manual clock_gettime calls which tend to be bulkier.
* executor: ignore unshare errors in setuid sandboxDmitry Vyukov2018-07-271-4/+8
| | | | We already do this in sandbox=none, but forgot about setuid.
* executor: remove unused fileDmitry Vyukov2018-07-251-240/+0
| | | | Leftover after "executor: overhaul".
* executor: fix strict aliasing violationsDmitry Vyukov2018-07-241-7/+16
| | | | | | | | | test_copyin does bad things. Fix that. executor/test.h: In function ‘int test_copyin()’: executor/common.h:299:16: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] *(type*)(addr) = (type)(val); \ ^
* executor: overhaulDmitry Vyukov2018-07-2435-7252/+6620
| | | | | | | | | | | | | | | | | 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.