aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/repro
diff options
context:
space:
mode:
authorMarco Vanotti <mvanotti@google.com>2019-10-30 18:16:22 -0700
committerMarco Vanotti <mvanotti@users.noreply.github.com>2019-12-09 15:13:49 -0800
commit607350e438a212477ce42ba3e85e82bc570d459a (patch)
tree512b550c35536d6b3b2fbdb8bff49c8fe96e2ef0 /pkg/repro
parent1f9a4e330bd054cd88f7fc662197f33bfa7ceff0 (diff)
syz/targets: add SyzExecutorCmd flag
This commit adds a new attribute to syzkaller targets that tells syzkaller how to invoke the syz-executor command. Some systems, like Fuchsia, are now building syz-executor as part of the build, and there is no need to copy it over, or to run it from `/tmp`. In fact, that might stop working at some time in the future in Fuchsia. All places that used to copy syz-executor into the target machine will now check for the SyzExecutorCmd flag, and won't copy it if the flag is set.
Diffstat (limited to 'pkg/repro')
-rw-r--r--pkg/repro/repro.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go
index c9ba11af0..2faefe306 100644
--- a/pkg/repro/repro.go
+++ b/pkg/repro/repro.go
@@ -18,6 +18,7 @@ import (
"github.com/google/syzkaller/pkg/osutil"
"github.com/google/syzkaller/pkg/report"
"github.com/google/syzkaller/prog"
+ "github.com/google/syzkaller/sys/targets"
"github.com/google/syzkaller/vm"
)
@@ -138,18 +139,21 @@ func Run(crashLog []byte, cfg *mgrconfig.Config, reporter report.Reporter, vmPoo
time.Sleep(10 * time.Second)
continue
}
- executorBin, err := vmInst.Copy(cfg.SyzExecutorBin)
- if err != nil {
- ctx.reproLog(0, "failed to copy to VM: %v", err)
- vmInst.Close()
- time.Sleep(10 * time.Second)
- continue
+ executorCmd := targets.Get(cfg.TargetOS, cfg.TargetArch).SyzExecutorCmd
+ if executorCmd == "" {
+ executorCmd, err = vmInst.Copy(cfg.SyzExecutorBin)
+ if err != nil {
+ ctx.reproLog(0, "failed to copy to VM: %v", err)
+ vmInst.Close()
+ time.Sleep(10 * time.Second)
+ continue
+ }
}
inst = &instance{
Instance: vmInst,
index: vmIndex,
execprogBin: execprogBin,
- executorBin: executorBin,
+ executorBin: executorCmd,
}
break
}