Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions syz-cluster/workflow/fuzz-step/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,19 @@ func shouldSkipFuzzing(baseSymbols, patchedSymbols map[string]string) bool {
log.Logf(0, "skipped the binary equality check because some of them have 0 symbols")
return false
}
if len(baseSymbols) == len(patchedSymbols) {
for name, hash := range baseSymbols {
if patchedSymbols[name] != hash {
log.Logf(0, "binaries are different, continuing fuzzing")
return false
}
same := len(baseSymbols) == len(patchedSymbols)
for name, hash := range baseSymbols {
if patchedSymbols[name] != hash {
same = false
break
}
}
log.Logf(0, "binaries are the same, no sense to do fuzzing")
return true
if same {
log.Logf(0, "binaries are the same, no sense to do fuzzing")
return true
}
log.Logf(0, "binaries are different, continuing fuzzing")
return false
}

func readSymbolHashes() (base, patched map[string]string, err error) {
Expand Down
8 changes: 7 additions & 1 deletion syz-cluster/workflow/fuzz-step/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ func TestShouldSkipFuzzing(t *testing.T) {
map[string]string{"A": "1", "B": "2"},
))
})
t.Run("different", func(t *testing.T) {
t.Run("same len, different hashes", func(t *testing.T) {
assert.False(t, shouldSkipFuzzing(
map[string]string{"A": "1", "B": "2"},
map[string]string{"A": "1", "B": "different"},
))
})
t.Run("different len, same hashes", func(t *testing.T) {
assert.False(t, shouldSkipFuzzing(
map[string]string{"A": "1", "B": "2", "C": "3"},
map[string]string{"A": "1", "B": "2"},
))
})
}
Loading