From bc1a1b50f942408a9139887b914f745d9fa02adc Mon Sep 17 00:00:00 2001 From: Stefan Wiehler Date: Mon, 2 Dec 2024 16:00:37 +0100 Subject: all: add support for binaries shipped with target In some build environments (notably Yocto), syzkaller host and target binaries end up in separate packages for each built architecture, which are then shipped with the respective image/SDK. Add the "Execprog/ExecutorBinOnTarget" and "StraceBinOnTarget" options to the manager config, which when set expects the respective binaries to be shipped with the target image and does not attempt to copy them from the host. --- pkg/instance/execprog.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pkg/instance/execprog.go') diff --git a/pkg/instance/execprog.go b/pkg/instance/execprog.go index e21f61a67..d8aaa5a7e 100644 --- a/pkg/instance/execprog.go +++ b/pkg/instance/execprog.go @@ -50,9 +50,13 @@ const ( func SetupExecProg(vmInst *vm.Instance, mgrCfg *mgrconfig.Config, reporter *report.Reporter, opt *OptionalConfig) (*ExecProgInstance, error) { - execprogBin, err := vmInst.Copy(mgrCfg.ExecprogBin) - if err != nil { - return nil, &TestError{Title: fmt.Sprintf("failed to copy syz-execprog to VM: %v", err)} + var err error + execprogBin := mgrCfg.SysTarget.ExecprogBin + if execprogBin == "" { + execprogBin, err = vmInst.Copy(mgrCfg.ExecprogBin) + if err != nil { + return nil, &TestError{Title: fmt.Sprintf("failed to copy syz-execprog to VM: %v", err)} + } } executorBin := mgrCfg.SysTarget.ExecutorBin if executorBin == "" { @@ -70,7 +74,7 @@ func SetupExecProg(vmInst *vm.Instance, mgrCfg *mgrconfig.Config, reporter *repo } if opt != nil { ret.OptionalConfig = *opt - if ret.StraceBin != "" { + if !mgrCfg.StraceBinOnTarget && ret.StraceBin != "" { var err error ret.StraceBin, err = vmInst.Copy(ret.StraceBin) if err != nil { -- cgit mrf-deployment