diff options
| author | Stefan Wiehler <me@sephalon.net> | 2024-12-02 16:00:37 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-12-17 11:13:44 +0000 |
| commit | bc1a1b50f942408a9139887b914f745d9fa02adc (patch) | |
| tree | 1c41777ce9ba26e8efe80e3fc6d717bde44be707 /pkg/instance/execprog.go | |
| parent | f93b2b552ce5fe589b450ff74ca1b459cdbc71a8 (diff) | |
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.
Diffstat (limited to 'pkg/instance/execprog.go')
| -rw-r--r-- | pkg/instance/execprog.go | 12 |
1 files changed, 8 insertions, 4 deletions
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 { |
