From 8fa0c867d4e4bbd97321b19ac11115fa7020570a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 20 Oct 2017 12:23:21 +0200 Subject: syz-fuzzer: generates hints only for the call that gave new coverage During smashing we know what call gave new coverage, so we can concentrate just on it. This helps to reduce amount of hints generated (we have too many of them). --- tools/syz-execprog/execprog.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go index 9a9a1b48a..6c5df9ffd 100644 --- a/tools/syz-execprog/execprog.go +++ b/tools/syz-execprog/execprog.go @@ -179,7 +179,8 @@ func main() { if *flagHints { compMaps := ipc.GetCompMaps(info) ncomps, ncandidates := 0, 0 - for _, comps := range compMaps { + for i := range p.Calls { + comps := compMaps[i] for v, args := range comps { ncomps += len(args) if *flagOutput == "stdout" { @@ -190,13 +191,13 @@ func main() { fmt.Printf("\n") } } + p.MutateWithHints(i, comps, func(p *prog.Prog) { + ncandidates++ + if *flagOutput == "stdout" { + fmt.Printf("PROGRAM:\n%s\n", p.Serialize()) + } + }) } - p.MutateWithHints(compMaps, func(p *prog.Prog) { - ncandidates++ - if *flagOutput == "stdout" { - fmt.Printf("PROGRAM:\n%s\n", p.Serialize()) - } - }) fmt.Printf("ncomps=%v ncandidates=%v\n", ncomps, ncandidates) } return true -- cgit mrf-deployment