diff options
| author | Jouni Hogander <jouni.hogander@unikie.com> | 2020-11-19 09:30:42 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-12-10 12:57:35 +0100 |
| commit | 1b96fc56ed8ba1be4feb10b1f9658d64a65f5d4b (patch) | |
| tree | c3e43b1cbe5daf35044512671f99ab445cf6f646 /tools/syz-bisect | |
| parent | 1b7c5ffa41acdbd6603afb7bd04a580a79346dbc (diff) | |
tools/syz-bisect: use kernel configs from configuration file
Currently syz-bisect is expecting to find kernel.config and
kernel_baseline.config from given crashdir. Unify with syz-ci
and use configuration files from bisect config file.
Diffstat (limited to 'tools/syz-bisect')
| -rw-r--r-- | tools/syz-bisect/bisect.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/syz-bisect/bisect.go b/tools/syz-bisect/bisect.go index d100797dd..e0ada90cc 100644 --- a/tools/syz-bisect/bisect.go +++ b/tools/syz-bisect/bisect.go @@ -14,7 +14,6 @@ // - repro.opts: syzkaller reproducer options (e.g. {"procs":1,"sandbox":"none",...}) (optional) // - syzkaller.commit: hash of syzkaller commit which was used to trigger the crash // - kernel.commit: hash of kernel commit on which the crash was triggered -// - kernel.config: kernel config file package main import ( @@ -56,6 +55,10 @@ type Config struct { // dashboard/config/upstream-selinux.cmdline Sysctl string `json:"sysctl"` Cmdline string `json:"cmdline"` + + KernelConfig string `json:"kernel_config"` + KernelBaselineConfig string `json:"kernel_baseline_config"` + // Manager config that was used to obtain the crash. Manager json.RawMessage `json:"manager"` } @@ -101,11 +104,11 @@ func main() { } loadString("syzkaller.commit", &cfg.Syzkaller.Commit) loadString("kernel.commit", &cfg.Kernel.Commit) - loadFile("kernel.config", &cfg.Kernel.Config, true) - loadFile("kernel.baseline_config", &cfg.Kernel.BaselineConfig, false) - loadFile("repro.prog", &cfg.Repro.Syz, false) - loadFile("repro.cprog", &cfg.Repro.C, false) - loadFile("repro.opts", &cfg.Repro.Opts, true) + loadFile("", mycfg.KernelConfig, &cfg.Kernel.Config, true) + loadFile("", mycfg.KernelBaselineConfig, &cfg.Kernel.BaselineConfig, false) + loadFile(*flagCrash, "repro.prog", &cfg.Repro.Syz, false) + loadFile(*flagCrash, "repro.cprog", &cfg.Repro.C, false) + loadFile(*flagCrash, "repro.opts", &cfg.Repro.Opts, false) if len(cfg.Repro.Syz) == 0 && len(cfg.Repro.C) == 0 { fmt.Fprintf(os.Stderr, "no repro.cprog or repro.prog found\n") @@ -127,8 +130,8 @@ func loadString(file string, dst *string) { *dst = strings.TrimSpace(string(data)) } -func loadFile(file string, dst *[]byte, mandatory bool) { - filename := filepath.Join(*flagCrash, file) +func loadFile(path, file string, dst *[]byte, mandatory bool) { + filename := filepath.Join(path, file) if !mandatory && !osutil.IsExist(filename) { return } |
