aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/runtest
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-09-28 14:25:01 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-09-28 14:57:20 +0200
commit7296c0747fa69e6f20a507aafcb3e1a77ea0f430 (patch)
tree0bdef730c82bba28e0abed8876b40dd9be8406fb /pkg/runtest
parenta6143bc982398127935fc6669e685ef1b3d44d29 (diff)
pkg/host: improve KMEMLEAK support
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.
Diffstat (limited to 'pkg/runtest')
-rw-r--r--pkg/runtest/run.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go
index 115f5ecb7..0ec0bb125 100644
--- a/pkg/runtest/run.go
+++ b/pkg/runtest/run.go
@@ -26,6 +26,7 @@ import (
"github.com/google/syzkaller/pkg/csource"
"github.com/google/syzkaller/pkg/host"
"github.com/google/syzkaller/pkg/ipc"
+ "github.com/google/syzkaller/pkg/ipc/ipcconfig"
"github.com/google/syzkaller/pkg/osutil"
"github.com/google/syzkaller/prog"
"github.com/google/syzkaller/sys/targets"
@@ -307,14 +308,11 @@ func (ctx *Context) createSyzTest(p *prog.Prog, sandbox string, threaded, cov bo
if sysTarget.ExecutorUsesForkServer {
cfg.Flags |= ipc.FlagUseForkServer
}
- switch sandbox {
- case "namespace":
- cfg.Flags |= ipc.FlagSandboxNamespace
- case "setuid":
- cfg.Flags |= ipc.FlagSandboxSetuid
- case "android_untrusted_app":
- cfg.Flags |= ipc.FlagSandboxAndroidUntrustedApp
+ sandboxFlags, err := ipcconfig.SandboxToFlags(sandbox)
+ if err != nil {
+ return nil, err
}
+ cfg.Flags |= sandboxFlags
if threaded {
opts.Flags |= ipc.FlagThreaded | ipc.FlagCollide
}