aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/host_freebsd.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/vminfo: move feature checking to hostDmitry Vyukov2024-05-151-19/+0
| | | | | | | | | | | | | | | | | Feature checking procedure is split into 2 phases: 1. syz-fuzzer invokes "syz-executor setup feature" for each feature one-by-one, and checks if executor does not fail. Executor can also return a special "this feature does not need custom setup", this allows to not call setup of these features in each new VM. 2. pkg/vminfo runs a simple program with ipc.ExecOpts specific for a concrete feature, e.g. for wifi injection it will try to run a program with wifi feature enabled, if setup of the feature fails, executor should also exit with an error. For coverage features we also additionally check that we actually got coverage. Then pkg/vminfo combines results of these 2 checks into final result. syz-execprog now also uses vminfo package and mimics the same checking procedure. Update #1541
* all: adapt to how mmapping a kcov instance works in LinuxAleksandr Nogikh2021-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | It turns out that the current Linux implementation of KCOV does not properly handle multiple mmap invocations on the same instance. The first one succeedes, but the subsequent ones do not actually mmap anything, yet returning no error at all. The ability to mmap that memory multiple times allows us to increase syz-executor performance and it would be a pity to completely lose it (especially given that mmapping kcov works fine on *BSD). In some time a patch will be prepared, but still we will have to support both versions at the same time - the buggy one and the correct one. Detect whether the bug is present by writing a value at the pointer returned by mmap. If it is present, disable dynamic kcov mmapping and pre-mmap 5 instances in the main() function - it should be enough for all reasonable uses. Otherwise, pre-mmap 3 and let syz-executor mmap them as needed.
* pkg/host: rename some featuresDmitry Vyukov2019-11-161-1/+1
| | | | | Rename some features in preparation for subsequent changes which will align names across the code base.
* pkg/host: enable FeatureComparisons on FreeBSDMichael Tuexen2019-01-201-0/+1
| | | | Same as https://github.com/google/syzkaller/pull/952, just for FreeBSD.
* fuzzer: speed up syscall support detectionAndrey Konovalov2019-01-081-1/+1
| | | | | | | 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.
* executor: add support for tap interfaces on FreeBSDMichael Tüxen2018-12-011-0/+1
|
* pkg/host: enable coverage on freebsd, disable on netbsdDmitry Vyukov2018-08-251-0/+4
| | | | | I messed it up during refactoring. It's freebsd that has coverage support.
* executor: rework fallback coverageDmitry Vyukov2018-06-221-4/+0
| | | | | | | | | | We have fallback coverage implmentation for freebsd. 1. It's broken after some recent changes. 2. We need it for fuchsia, windows, akaros, linux too. 3. It's painful to work with C code. Move fallback coverage to ipc package, fix it and provide for all OSes.
* pkg/host: rework host feature detection/setupDmitry Vyukov2018-06-121-2/+2
| | | | | | | | | | 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: explain why syscalls are disabledDmitry Vyukov2018-04-061-7/+2
|
* sys/linux: add syz_init_net_socket syscallDmitry Vyukov2018-03-051-1/+1
| | | | | | | | | | | 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.
* executor, pkg/ipc: unify ipc protocol between linux and other OSesDmitry Vyukov2017-10-161-0/+4
| | | | | | | | | | | | | | | | | 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.
* all: basic freebsd supportDmitry Vyukov2017-10-021-0/+17
For now we just make Go part build for freebsd.