From 95696db519b9375ae7350800e30c7f56249aa14f Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 14 Aug 2024 13:40:17 +0200 Subject: syz-manager: favorize smaller corpus programs Sort seeds by the number of calls in the program, so that the fuzzer triages the smaller programs first. This should prevent the overshadowing of smaller programs by the larger ones. --- syz-manager/manager.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 2efacc4c8..21d568d67 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -17,6 +17,7 @@ import ( "os/exec" "path/filepath" "runtime" + "sort" "sync" "sync/atomic" "time" @@ -654,6 +655,10 @@ func (mgr *Manager) loadCorpus() []fuzzer.Candidate { candidates = append(candidates, item) } log.Logf(0, "%-24v: %v (%v seeds)", "corpus", len(candidates), seeds) + // Let's favorize smaller programs, otherwise the poorly minimized ones may overshadow the rest. + sort.SliceStable(candidates, func(i, j int) bool { + return len(candidates[i].Prog.Calls) < len(candidates[j].Prog.Calls) + }) return candidates } -- cgit mrf-deployment