aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-crush
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-crush
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-crush')
-rw-r--r--tools/syz-crush/crush.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/syz-crush/crush.go b/tools/syz-crush/crush.go
index 36424c61a..a88041a37 100644
--- a/tools/syz-crush/crush.go
+++ b/tools/syz-crush/crush.go
@@ -31,6 +31,7 @@ var (
flagDebug = flag.Bool("debug", false, "dump all VM output to console")
flagRestartTime = flag.Duration("restart_time", 0, "how long to run the test")
flagInfinite = flag.Bool("infinite", true, "by default test is run for ever, -infinite=false to stop on crash")
+ flagStrace = flag.Bool("strace", false, "run under strace (binary must be set in the config file")
)
type FileType int
@@ -59,6 +60,9 @@ func main() {
} else {
log.Printf("running until crash is found or till %v", *flagRestartTime)
}
+ if *flagStrace && cfg.StraceBin == "" {
+ log.Fatalf("strace_bin must not be empty in order to run with -strace")
+ }
vmPool, err := vm.Create(cfg, *flagDebug)
if err != nil {
@@ -160,6 +164,9 @@ func runInstance(cfg *mgrconfig.Config, reporter *report.Reporter,
optArgs := &instance.OptionalConfig{
ExitCondition: vm.ExitTimeout,
}
+ if *flagStrace {
+ optArgs.StraceBin = cfg.StraceBin
+ }
var err error
inst, err := instance.CreateExecProgInstance(vmPool, index, cfg, reporter, optArgs)
if err != nil {