aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/common.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/csource: add support for creating reproducers on OpenBSDAnton Lindqvist2018-11-171-1/+2
|
* RFC: android: Add support for untrusted_app sandboxing (#697)Zach Riggle2018-09-171-26/+28
| | | | | | | | | | | | | | | | | | | | | executor: add support for android_untrusted_app sandbox This adds a new sandbox type, 'android_untrusted_app', which restricts syz-executor to the privileges which are available to third-party applications, e.g. those installed from the Google Play store. In particular, this uses the UID space reserved for applications (instead of the 'setuid' sandbox, which uses the traditional 'nobody' user / 65534) as well as a set of groups which the Android-specific kernels are aware of, and finally ensures that the SELinux context is set appropriately. Dependencies on libselinux are avoided by manually implementing the few functions that are needed to change the context of the current process, and arbitrary files. The underlying mechanisms are relatively simple. Fixes google/syzkaller#643 Test: make presubmit Bug: http://b/112900774
* pkg/csource: refactor defineListDmitry Vyukov2018-08-021-76/+35
| | | | | | Make it simpler and shorter. Update #538
* pkg/csource: rafactor option checkingDmitry Vyukov2018-07-311-3/+1
| | | | Update #538
* pkg/csource: rewrite gen.sh in GoDmitry Vyukov2018-07-271-1/+1
| | | | | | | | | | Shell files cause portability problems. On Linux it's hard to install /bin/sh, /bin/bash is not present on *BSD. Any solution is hard to test on Darwin. Don't even want to mention Windows. Just do it in Go.
* pkg/csource: add option to trace syscall resultsDmitry Vyukov2018-07-271-0/+6
| | | | This will be needed for testing of generated programs.
* pkg/csource: tidy generated codeDmitry Vyukov2018-07-271-9/+27
| | | | | | | | | | | 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: overhaulDmitry Vyukov2018-07-241-14/+24
| | | | | | | | | | | | | | | | | 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-3/+6
| | | | Lots of assorted heavylifting to support csource on fuchsia.
* 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.
* pkg/csource: minimize netdevices and net resetDmitry Vyukov2018-05-171-3/+6
| | | | | | Add separate options to minimize netdevices setup and net namespace reset. Fixes #581
* sys/linux: add cgroup descriptionsDmitry Vyukov2018-03-251-0/+3
|
* all: fix gometalinter warningsDmitry Vyukov2018-03-081-1/+1
| | | | Fix typos, non-canonical code, remove dead code, etc.
* prog: combine RequiresBitmasks and RequiresChecksums into RequiredFeaturesDmitry Vyukov2018-02-191-2/+3
|
* sys/linux: extend netfilter descriptionsDmitry Vyukov2018-01-271-0/+3
|
* executor: introduce uint64/32/16/8 typesDmitry Vyukov2017-12-271-0/+10
| | | | | | | | | | | | | | | 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.
* pkg/csource: refactorDmitry Vyukov2017-12-171-0/+123
| | | | | | | csource.go is too large and messy. Move Build/Format into buid.go. Move generation of common header into common.go. Split generation of common header into smaller managable functions.
* pkg/csource: support akarosDmitry Vyukov2017-10-161-2042/+0
|
* 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.
* executor: include missing headerDmitry Vyukov2017-10-101-3/+6
| | | | writev requires <sys/uio.h>. Include it.
* 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-251-54/+59
|
* all: more assorted fuchsia supportDmitry Vyukov2017-09-221-147/+148
|
* 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-241-2/+0
| | | | | | 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: regenerateDmitry Vyukov2017-06-261-0/+2
|
* pkg/csource: move from csourceDmitry Vyukov2017-06-171-0/+1975