From 607350e438a212477ce42ba3e85e82bc570d459a Mon Sep 17 00:00:00 2001 From: Marco Vanotti Date: Wed, 30 Oct 2019 18:16:22 -0700 Subject: 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. --- pkg/repro/repro.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'pkg/repro') 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 } -- cgit mrf-deployment