aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/fuzzer/queue
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-06-04 12:55:41 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-06-24 09:57:34 +0000
commite16e2c9a4cb6937323e861b646792a6c4c978a3c (patch)
tree6c513e98e5f465b44a98546d8984485d2c128582 /pkg/fuzzer/queue
parent90d67044dab68568e8f35bc14b68055dbd166eff (diff)
executor: add runner mode
Move all syz-fuzzer logic into syz-executor and remove syz-fuzzer. Also restore syz-runtest functionality in the manager. Update #4917 (sets most signal handlers to SIG_IGN)
Diffstat (limited to 'pkg/fuzzer/queue')
-rw-r--r--pkg/fuzzer/queue/queue.go27
1 files changed, 26 insertions, 1 deletions
diff --git a/pkg/fuzzer/queue/queue.go b/pkg/fuzzer/queue/queue.go
index 46df9d234..051f7205e 100644
--- a/pkg/fuzzer/queue/queue.go
+++ b/pkg/fuzzer/queue/queue.go
@@ -37,7 +37,6 @@ type Request struct {
// Options needed by runtest.
BinaryFile string // If set, it's executed instead of Prog.
- Repeat int // Repeats in addition to the first run.
// Important requests will be retried even from crashed VMs.
Important bool
@@ -113,6 +112,11 @@ func (r *Request) Validate() error {
if (collectComps) && (collectSignal || collectCover) {
return fmt.Errorf("hint collection is mutually exclusive with signal/coverage")
}
+ sandboxes := flatrpc.ExecEnvSandboxNone | flatrpc.ExecEnvSandboxSetuid |
+ flatrpc.ExecEnvSandboxNamespace | flatrpc.ExecEnvSandboxAndroid
+ if r.BinaryFile == "" && r.ExecOpts.EnvFlags&sandboxes == 0 {
+ return fmt.Errorf("no sandboxes set")
+ }
return nil
}
@@ -415,3 +419,24 @@ func (d *Deduplicator) onDone(req *Request, res *Result) bool {
}
return true
}
+
+// DefaultOpts applies opts to all requests in source.
+func DefaultOpts(source Source, opts flatrpc.ExecOpts) Source {
+ return &defaultOpts{source, opts}
+}
+
+type defaultOpts struct {
+ source Source
+ opts flatrpc.ExecOpts
+}
+
+func (do *defaultOpts) Next() *Request {
+ req := do.source.Next()
+ if req == nil {
+ return nil
+ }
+ req.ExecOpts.ExecFlags |= do.opts.ExecFlags
+ req.ExecOpts.EnvFlags |= do.opts.EnvFlags
+ req.ExecOpts.SandboxArg = do.opts.SandboxArg
+ return req
+}