aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-repro
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-04-01 13:16:03 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-04-29 17:16:33 +0200
commit2d51d57a71659b063ddcb21cc50845d05d39708b (patch)
tree6662e29b20177356ebbc0a4658890e43c39e1e78 /tools/syz-repro
parent33d1aba90b07c4319e1617be24f6f6dfd1b71d5e (diff)
all: run strace on each found reproducer
If `strace_bin` is specified, syzkaller will invoke a reproducer with it and save the output. This should help in debugging. If syz-manager is attached to a dashboard, upload the strace-powered output and report.
Diffstat (limited to 'tools/syz-repro')
-rw-r--r--tools/syz-repro/repro.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/syz-repro/repro.go b/tools/syz-repro/repro.go
index 6622b8203..247cc11cd 100644
--- a/tools/syz-repro/repro.go
+++ b/tools/syz-repro/repro.go
@@ -25,6 +25,7 @@ var (
flagDebug = flag.Bool("debug", false, "print debug output")
flagOutput = flag.String("output", filepath.Join(".", "repro.txt"), "output description file (output.txt)")
flagCRepro = flag.String("crepro", filepath.Join(".", "repro.c"), "output c file (repro.c)")
+ flagStrace = flag.String("strace", "", "output strace log (strace_bin must be set)")
)
func main() {
@@ -104,4 +105,21 @@ func main() {
log.Logf(0, "failed to write C repro to file: %v", err)
}
}
+ if *flagStrace != "" {
+ result := repro.RunStrace(res, cfg, reporter, vmPool, vmIndexes[0])
+ if result.Error != nil {
+ log.Logf(0, "failed to run strace: %v", result.Error)
+ } else {
+ if result.Report != nil {
+ log.Logf(0, "under strace repro crashed with title: %s", result.Report.Title)
+ } else {
+ log.Logf(0, "repro didn't crash under strace")
+ }
+ if err := osutil.WriteFile(*flagStrace, result.Output); err == nil {
+ fmt.Printf("C file saved to %s\n", *flagStrace)
+ } else {
+ log.Logf(0, "failed to write strace output to file: %v", err)
+ }
+ }
+ }
}