aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/host_linux.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/host: don't fail if CONFIG_FAIL_FUTEX is not enabledDmitry Vyukov2019-02-111-5/+8
| | | | | | See #991 and added comments. Fixes #991
* kcov: some fixes for extra coverageAndrey Konovalov2019-01-171-1/+1
| | | | | | Use PC tracing mode when detecting KCOV_REMOTE_ENABLE support in the kernel. Also fix kcov_remote_handle_usb argument.
* all: detect extra coverage supportAndrey Konovalov2019-01-161-6/+43
| | | | Based on whether the kernel supports KCOV_REMOTE_ENABLE ioctl.
* pkg/host: Support extracting kallsyms on ppc64leAndrew Donnellan2019-01-151-0/+2
| | | | | | | Add a regex for syscall symbol extraction on ppc64le. ppc64le doesn't have any special arch prefix. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
* fuzzer: fix syscall detectionAndrey Konovalov2019-01-081-2/+2
| | | | | As pointed out my Mark Rutland, kallsyms entries have format of __ia32_sys_${NAME} rather than __ia32_${NAME}. Fix the regexps.
* fuzzer: speed up syscall support detectionAndrey Konovalov2019-01-081-12/+31
| | | | | | | 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.
* pkg/host: improve KMEMLEAK detectionDmitry Vyukov2018-10-101-7/+9
| | | | | | | | EBUSY is returned when KMEMLEAK is in fact turned off, not when scanning is already turned off. That can't be recovered. So instead check that we can write to the file in the check function and give useful diagnostics.
* pkg/host: improve KMEMLEAK supportDmitry Vyukov2018-09-281-27/+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-0/+8
| | | | | | | | | | | | | | | | | | | | | 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-0/+2
| | | | | | The function executes random code. Update #310
* sys/linux: add ext4 ioctls and overlayfsDmitry Vyukov2018-08-291-0/+4
| | | | Update #533
* gometalinter: strengthen gocyclo limitDmitry Vyukov2018-08-021-0/+4
| | | | | | Strengthen gocycle limit 35->24! Yay! No more jumbo functions! Fixes #538
* gometalinter: clean up some errcheck warningsDmitry Vyukov2018-08-021-4/+13
| | | | | | | Check some errors where relevant. Unfortunately enabling errcheck does not look feasible, too many warnings. Update #538
* pkg/host: add "network devices" featureDmitry Vyukov2018-07-131-0/+9
| | | | | | 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.
* sys/linux: implement fuse as normal syscallsDmitry Vyukov2018-07-101-17/+33
| | | | | Remove syz_fuse* and implement them as normal syscalls. We not have enough expressive power to form mount options.
* pkg/host: check that we can open files rather than that they existDmitry Vyukov2018-07-101-15/+19
| | | | | | | See issue #640 where /dev/net/tun is present, but open fails with ENODEV. Check that we can actually open all these files. Fixes #640
* pkg/host: more precise detection for syz_mount_image supportDmitry Vyukov2018-06-181-5/+22
|
* pkg/host: support trial supported syscall detectionDmitry Vyukov2018-06-181-13/+57
| | | | | Detect supported syscall by directly executing them if kallsyms is not present. This is required for gvisor testing.
* pkg/host: better detection of supported socketsDmitry Vyukov2018-06-181-2/+20
| | | | | Check socketpair. Check non-constant socket types.
* all: fix gometalinter warningsDmitry Vyukov2018-06-121-8/+15
|
* pkg/host: rework host feature detection/setupDmitry Vyukov2018-06-121-7/+228
| | | | | | | | | | 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
* pkg/host: fix syz_mount_image detectionDmitry Vyukov2018-04-291-1/+1
| | | | Only init admin can mount filesystems with images.
* pkg/host: enable more fault injectionDmitry Vyukov2018-04-271-2/+11
|
* pkg/host: fix kallsyms names againDmitry Vyukov2018-04-191-1/+3
| | | | Some x86 syscalls now seem to be __x64_ and __ia32_ instead of sys_ or ksys_.
* pkg/host: fix kallsyms checkDmitry Vyukov2018-04-181-1/+2
| | | | | | Recent kernel changes to not call syscalls directly from kernel code renamed syscall symbols from sys_foo to ksys_foo. Support both formats.
* pkg/host: refactor codeDmitry Vyukov2018-04-081-26/+22
| | | | Fix warnings pointed out by gometalinter.
* pkg/host: explain why syscalls are disabledDmitry Vyukov2018-04-061-48/+79
|
* sys/linux: add support for reading partition tablesDmitry Vyukov2018-04-011-0/+2
|
* sys/linux: add support for mounting filesystem imagesDmitry Vyukov2018-03-301-0/+2
|
* sys/linux: add cgroup descriptionsDmitry Vyukov2018-03-251-1/+1
|
* sys/linux: add netlink fou descriptionsDmitry Vyukov2018-03-211-0/+7
|
* all: fix gometalinter warningsDmitry Vyukov2018-03-081-1/+1
| | | | Fix typos, non-canonical code, remove dead code, etc.
* sys/linux: add syz_init_net_socket syscallDmitry Vyukov2018-03-051-24/+23
| | | | | | | | | | | The new pseudo syscall allows opening sockets that can only be created in init net namespace (BLUETOOTH, NFC, LLC). Use it to open these sockets. Unfortunately this only works with sandbox none at the moment. The problem is that setns of a network namespace requires CAP_SYS_ADMIN in the target namespace, and we've lost all privs in the init namespace during creation of a user namespace.
* sys: move test syscalls to a separate targetDmitry Vyukov2017-12-171-2/+0
| | | | | | We have them in linux solely for historical reasons. Fixes #462
* sys/linux: open files from /procDmitry Vyukov2017-11-271-0/+2
|
* sys/linux: remove get_kernel_syms, add quotactl syscallDmitry Vyukov2017-11-201-1/+13
| | | | | | get_kernel_syms does not seem to be present upstream. Describe an old quotactl syscall. Also fix umount/umount2 names in kallsyms.
* executor, pkg/ipc: unify ipc protocol between linux and other OSesDmitry Vyukov2017-10-161-0/+11
| | | | | | | | | | | | | | | | | 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/host: add fuchsia supportDmitry Vyukov2017-09-201-0/+161