syz-manager/mgrconfig: fix selection of executor binary

We currently select executor for vm arch, need to select target arch.
This breaks linux/amd64/386 configuration where we select amd64 instead of 386.
This commit is contained in:
Dmitry Vyukov 2017-10-18 16:48:18 +02:00
parent 296be8cc8d
commit 441d64d9a5

View File

@ -109,16 +109,16 @@ func load(data []byte, filename string) (*Config, error) {
return nil, err
}
targetBin := func(name string) string {
targetBin := func(name, arch string) string {
exe := ""
if cfg.TargetOS == "windows" {
exe = ".exe"
}
return filepath.Join(cfg.Syzkaller, "bin", cfg.TargetOS+"_"+cfg.TargetVMArch, name+exe)
return filepath.Join(cfg.Syzkaller, "bin", cfg.TargetOS+"_"+arch, name+exe)
}
cfg.SyzFuzzerBin = targetBin("syz-fuzzer")
cfg.SyzExecprogBin = targetBin("syz-execprog")
cfg.SyzExecutorBin = targetBin("syz-executor")
cfg.SyzFuzzerBin = targetBin("syz-fuzzer", cfg.TargetVMArch)
cfg.SyzExecprogBin = targetBin("syz-execprog", cfg.TargetVMArch)
cfg.SyzExecutorBin = targetBin("syz-executor", cfg.TargetArch)
if !osutil.IsExist(cfg.SyzFuzzerBin) {
return nil, fmt.Errorf("bad config syzkaller param: can't find %v", cfg.SyzFuzzerBin)
}