aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-10-16 12:18:50 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-10-16 14:21:54 +0200
commit85b1f93f8dbbc767c564e494a6353aa3517d5d49 (patch)
tree702d2318a2ddcf1a576294a6a4981c58abcfcf61 /sys
parentf78642861b4dbe396a67d5e2a750e22f83f3edd5 (diff)
executor, pkg/ipc: unify ipc protocol between linux and other OSes
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/targets/targets.go31
1 files changed, 23 insertions, 8 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index 042637306..4ec176b46 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -24,6 +24,11 @@ type os struct {
SyscallNumbers bool
// E.g. "__NR_" or "SYS_".
SyscallPrefix string
+ // ipc<->executor communication tuning.
+ // If ExecutorUsesShmem, programs and coverage are passed through shmem, otherwise via pipes.
+ ExecutorUsesShmem bool
+ // If ExecutorUsesForkServer, executor uses extended protocol with handshake.
+ ExecutorUsesForkServer bool
}
var List = map[string]map[string]*Target{
@@ -111,22 +116,32 @@ var List = map[string]map[string]*Target{
var oses = map[string]os{
"linux": {
- SyscallNumbers: true,
- SyscallPrefix: "__NR_",
+ SyscallNumbers: true,
+ SyscallPrefix: "__NR_",
+ ExecutorUsesShmem: true,
+ ExecutorUsesForkServer: true,
},
"freebsd": {
- SyscallNumbers: true,
- SyscallPrefix: "SYS_",
+ SyscallNumbers: true,
+ SyscallPrefix: "SYS_",
+ ExecutorUsesShmem: false,
+ ExecutorUsesForkServer: false,
},
"fuchsia": {
- SyscallNumbers: false,
+ SyscallNumbers: false,
+ ExecutorUsesShmem: false,
+ ExecutorUsesForkServer: false,
},
"windows": {
- SyscallNumbers: false,
+ SyscallNumbers: false,
+ ExecutorUsesShmem: false,
+ ExecutorUsesForkServer: false,
},
"akaros": {
- SyscallNumbers: true,
- SyscallPrefix: "SYS_",
+ SyscallNumbers: true,
+ SyscallPrefix: "SYS_",
+ ExecutorUsesShmem: false,
+ ExecutorUsesForkServer: false,
},
}