diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-08-14 13:40:17 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-08-14 13:03:10 +0000 |
| commit | 95696db519b9375ae7350800e30c7f56249aa14f (patch) | |
| tree | 7f7b41abb16611510b136faa28ba8e6bc0a6a65c /syz-manager | |
| parent | 6a5293d22d629e2467cae8e96dd343779c018612 (diff) | |
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.
Diffstat (limited to 'syz-manager')
| -rw-r--r-- | syz-manager/manager.go | 5 |
1 files changed, 5 insertions, 0 deletions
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 } |
