Skip to content

Commit b0cc480

Browse files
dvyukova-nogikh
authored andcommitted
syz-manager: fix panic in debug mode
When running in debug mode, mgr.vmPool.Count()-mgr.cfg.FuzzingVMs can become negative even for a valid config since we reduce number of VMs to 1. NewReproLoop panics when VM count argument is negative since it passes it to make chan. Cap number of repro VMs at 0.
1 parent 8079433 commit b0cc480

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

syz-manager/manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ func RunManager(mode *Mode, cfg *mgrconfig.Config) {
359359
}
360360
mgr.pool = vm.NewDispatcher(mgr.vmPool, mgr.fuzzerInstance)
361361
mgr.http.Pool = mgr.pool
362-
mgr.reproLoop = manager.NewReproLoop(mgr, mgr.vmPool.Count()-mgr.cfg.FuzzingVMs, mgr.cfg.DashboardOnlyRepro)
362+
reproVMs := max(0, mgr.vmPool.Count()-mgr.cfg.FuzzingVMs)
363+
mgr.reproLoop = manager.NewReproLoop(mgr, reproVMs, mgr.cfg.DashboardOnlyRepro)
363364
mgr.http.ReproLoop = mgr.reproLoop
364365
mgr.http.TogglePause = mgr.pool.TogglePause
365366

0 commit comments

Comments
 (0)