aboutsummaryrefslogtreecommitdiffstats
path: root/syz-manager
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-08-14 14:11:16 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-08-14 13:36:33 +0000
commita172b9377314018315aa261c1ed3324008e8dcea (patch)
tree64f2fb92098eaa769c0db12c0458cbf84ae0f19a /syz-manager
parentbb77518be889b2f4dadcaf7b0260d76dd5babd18 (diff)
syz-manager: distribute requests across instances
Distributing requests across VMs should help with the tail of more subtle issues even in snapshot more. For example, if the fuzzer locates output/kcov mappings in memory and injects coverage.
Diffstat (limited to 'syz-manager')
-rw-r--r--syz-manager/manager.go4
-rw-r--r--syz-manager/snapshot.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/syz-manager/manager.go b/syz-manager/manager.go
index 519c4cd0b..fe3398b69 100644
--- a/syz-manager/manager.go
+++ b/syz-manager/manager.go
@@ -101,7 +101,7 @@ type Manager struct {
mu sync.Mutex
fuzzer atomic.Pointer[fuzzer.Fuzzer]
- source queue.Source
+ snapshotSource *queue.Distributor
phase int
targetEnabledSyscalls map[*prog.Syscall]bool
@@ -1367,7 +1367,7 @@ func (mgr *Manager) MachineChecked(features flatrpc.Feature, enabledSyscalls map
source := queue.DefaultOpts(fuzzerObj, opts)
if mgr.cfg.Snapshot {
log.Logf(0, "restarting VMs for snapshot mode")
- mgr.source = source
+ mgr.snapshotSource = queue.Distribute(source)
mgr.pool.SetDefault(mgr.snapshotInstance)
mgr.serv.Close()
mgr.serv = nil
diff --git a/syz-manager/snapshot.go b/syz-manager/snapshot.go
index ece7974f2..1413ac744 100644
--- a/syz-manager/snapshot.go
+++ b/syz-manager/snapshot.go
@@ -48,7 +48,7 @@ func (mgr *Manager) snapshotLoop(ctx context.Context, inst *vm.Instance) error {
var envFlags flatrpc.ExecEnv
for first := true; ctx.Err() == nil; first = false {
queue.StatExecs.Add(1)
- req := mgr.source.Next()
+ req := mgr.snapshotSource.Next(inst.Index())
if first {
envFlags = req.ExecOpts.EnvFlags
if err := mgr.snapshotSetup(inst, builder, envFlags); err != nil {