aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/host.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/host: split files into syscalls/featuresDmitry Vyukov2019-11-161-152/+0
| | | | | pkg/host does 2 things: detects supported syscalls and supported features. There is enough code for each for a separate file.
* sys/targets: add HostFuzzer flagDmitry Vyukov2019-11-161-7/+5
| | | | | | | Move HostFuzzer from vm/qemu. It's needed in a number of other packages and strictly saying is not specific to qemu (it just happened that both fuchsia and akaros only support qemu).
* executor: move fixed pci devlink handle into network namespaceJiri Pirko2019-11-031-0/+2
| | | | | | | | In case there is a fixed pci devlink handle "pci/pci/0000:00:10.0" on the system (initial network namespace), it is moved to a working network namespace. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* executor, host, csource: Add support to enable KCSANMarco Elver2019-10-041-0/+5
| | | | | | | | | By default, the current KCSAN .config does not enable KCSAN during boot, since we encounter races during boot which would prevent syzkaller from ever executing. This adds support to detect if KCSAN is available, and enables it on the fuzzer host.
* all: convert Fuchsia to use "host fuzzing" modeMatthew Dempsky2019-08-271-3/+6
| | | | | | | | | Go support is not a priority for Fuchsia at the moment, so it's preferable to use host fuzzing mode for Fuchsia like currently done for Akaros. This commit basically looks for all the places where there was special logic for OS=="akaros" and extends the same logic for OS=="fuchsia".
* pkg/host: disable syz_execute_funcDmitry Vyukov2019-06-031-1/+16
| | | | See the added comment for explanation.
* pkg/runtest: test host.SetupDmitry Vyukov2019-05-211-1/+1
| | | | This would catch binfmt_misc breakage on non-linux.
* pkg/host: don't enable binfmt_misc on non-linuxDmitry Vyukov2019-05-211-1/+1
| | | | | | | The csource options lack any relation to the tested OS, while they do depend on the tested OS (most are linux-specific). As the result we enable binfmt_misc, but its setup fails on anything other than linux. As a work-around don't enable binfmt_misc on non-linux.
* executor: implement support for leak checkingDmitry Vyukov2019-05-201-24/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Leak checking support was half done and did not really work. This is heavy-lifting to make it work. 1. Move leak/fault setup into executor. pkg/host was a wrong place for them because we need then in C repros too. The pkg/host periodic callback functionality did not work too, we need it in executor so that we can reuse it in C repros too. Remove setup/callback functions in pkg/host entirely. 2. Do leak setup/checking in C repros. The way leak checking is invoked is slightly different from fuzzer, but much better then no support at all. At least the checking code is shared. 3. Add Leak option to pkg/csource and -leak flag to syz-prog2c. 4. Don't enalbe leak checking in fuzzer while we are triaging initial corpus. It's toooo slow. 5. Fix pkg/repro to do something more sane for leak bugs. Few other minor fixes here and there.
* all: detect extra coverage supportAndrey Konovalov2019-01-161-0/+2
| | | | Based on whether the kernel supports KCOV_REMOTE_ENABLE ioctl.
* fuzzer: speed up syscall support detectionAndrey Konovalov2019-01-081-1/+3
| | | | | | | Right now syz-fuzzer does a search through /proc/kallsyms for each syscall to check whether it's supported. Do one search instead and save the results to a map. This speeds up syscall detection ~60 times when testing arm64 kernel on x86. Also add another search pattern for arm64 and add some logging.
* openbsd: enable packet injectionGreg Steuck2018-11-191-1/+1
|
* pkg/host: improve KMEMLEAK supportDmitry Vyukov2018-09-281-11/+11
| | | | | | | | | | | Rewind kmemleak fd before reading it second time, otherwise we will read truncated reports. Auto-learn what leak reports we've already seen and ignore them in future. This is required because there are some false positives and some fire too frequently. So now we will hit each leak only once per manager run, but we still will try to reproduce them.
* RFC: android: Add support for untrusted_app sandboxing (#697)Zach Riggle2018-09-171-8/+10
| | | | | | | | | | | | | | | | | | | | | 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
* sys/linux: add syz_execute_funcDmitry Vyukov2018-08-301-1/+7
| | | | | | The function executes random code. Update #310
* pkg/host: support test OSDmitry Vyukov2018-07-271-3/+3
| | | | | | test OS parasitizeson other OSes just as akaros, and there is nothing to detect as well. So use the same stub for test as for akaros.
* pkg/host: add "network devices" featureDmitry Vyukov2018-07-131-0/+2
| | | | | | 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.
* pkg/host: disable for akarosDmitry Vyukov2018-07-061-2/+15
| | | | | | akaros can't have own host version because fuzzer does not run on akaros, so just disable it all.
* pkg/host: support trial supported syscall detectionDmitry Vyukov2018-06-181-0/+2
| | | | | Detect supported syscall by directly executing them if kallsyms is not present. This is required for gvisor testing.
* pkg/host: rework host feature detection/setupDmitry Vyukov2018-06-121-0/+79
| | | | | | | | | | 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
* gometalinter: enable line length checkingDmitry Vyukov2018-05-041-1/+2
| | | | | | | 120 columns looks like a reasonable limit and requires few changes to existing code. Update #538
* pkg/host: explain why syscalls are disabledDmitry Vyukov2018-04-061-0/+27
|
* pkg/host: add fuchsia supportDmitry Vyukov2017-09-201-161/+0
|
* pkg/compiler: don't genererate missing syscallsDmitry Vyukov2017-09-151-3/+0
| | | | | | | | We used to generate them only because manager had no idea what arch it is testing. So syscalls numbers had to match between all arches. This is not needed anymore. Also don't generate unreferenced structs/resources.
* prog: remove default target and all global stateDmitry Vyukov2017-09-151-2/+2
| | | | | | 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.
* prog, sys: move types to progDmitry Vyukov2017-09-051-16/+16
| | | | | | | | | | | 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-8/+8
| | | | | In preparation for moving sys types to prog to avoid confusion between sys.Call and prog.Call.
* pkg/compiler: restore generation of unsupported syscallsDmitry Vyukov2017-09-021-0/+3
| | | | | | Unfortunately this is sitll needed, see the added comment. Update #191
* pkg/compiler: check and generate typesDmitry Vyukov2017-09-021-3/+0
| | | | | | Move most of the logic from sysgen to pkg/compiler. Update #217
* pkg/host: move from hostDmitry Vyukov2017-06-171-0/+164