From 4adc00e894b5b48191bc248286bee600e712f99f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 21 May 2019 12:25:10 +0200 Subject: syz-manager: reproduce leaks from hub pkg/repro only enables leak checking when report type is MemoryLeak. Since repros from hub always have Unknown type, repro won't reproduce leaks. Always set report type to MemoryLeak on leak instances. --- syz-manager/hub.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/syz-manager/hub.go b/syz-manager/hub.go index bb818f7f8..5f85c8fe2 100644 --- a/syz-manager/hub.go +++ b/syz-manager/hub.go @@ -7,6 +7,7 @@ import ( "time" "github.com/google/syzkaller/pkg/hash" + "github.com/google/syzkaller/pkg/host" "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/mgrconfig" "github.com/google/syzkaller/pkg/report" @@ -21,6 +22,7 @@ func (mgr *Manager) hubSyncLoop() { target: mgr.target, stats: mgr.stats, enabledCalls: mgr.checkResult.EnabledCalls[mgr.cfg.Sandbox], + leak: mgr.checkResult.Features[host.FeatureLeakChecking].Enabled, fresh: mgr.fresh, hubReproQueue: mgr.hubReproQueue, } @@ -36,6 +38,7 @@ type HubConnector struct { target *prog.Target stats *Stats enabledCalls []int + leak bool fresh bool hubCorpus map[hash.Sig]bool newRepros [][]byte @@ -179,11 +182,19 @@ func (hc *HubConnector) processRepros(repros [][]byte) int { dropped++ continue } + // On a leak instance we override repro type to leak, + // because otherwise repro package won't even enable leak detection + // and we won't reproduce leaks from other instances. + typ := report.Unknown + if hc.leak { + typ = report.MemoryLeak + } hc.hubReproQueue <- &Crash{ vmIndex: -1, hub: true, Report: &report.Report{ Title: "external repro", + Type: typ, Output: repro, }, } -- cgit mrf-deployment