diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-10-07 21:42:56 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-10-07 21:42:56 +0200 |
| commit | 191a429c4c0e671dcfdf53d04e38796d28e2d5cf (patch) | |
| tree | 3652180a084f6390343cfd94a6259d93638eac7b | |
| parent | fbaafcd20067dea49eab8775154daf0a845eba20 (diff) | |
manager: save user tag with crash reports
If config contains "tag" parameter, save it along with crash reports.
The tag is meant to contain kernel branch/commit hash.
If workdir contains crashes from different kernel versions,
it is useful to be able to find out on what kernel revision a crash happened.
| -rw-r--r-- | config/config.go | 2 | ||||
| -rw-r--r-- | syz-manager/manager.go | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go index d8a0742c2..9a6cb4f08 100644 --- a/config/config.go +++ b/config/config.go @@ -23,6 +23,7 @@ type Config struct { Workdir string Vmlinux string Kernel string // e.g. arch/x86/boot/bzImage + Tag string // arbitrary optional tag that is saved along with crash reports (e.g. kernel branch/commit) Cmdline string // kernel command line Image string // linux image for VMs Initrd string // linux initial ramdisk. (optional) @@ -279,6 +280,7 @@ func checkUnknownFields(data []byte) (string, error) { "Workdir", "Vmlinux", "Kernel", + "Tag", "Cmdline", "Image", "Cpu", diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 2db2551ed..665c41211 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -308,6 +308,9 @@ func (mgr *Manager) saveCrasher(vmCfg *vm.Config, desc string, text, output []by if err := ioutil.WriteFile(fn, output, 0660); err != nil { continue } + if len(mgr.cfg.Tag) > 0 { + ioutil.WriteFile(filepath.Join(dir, fmt.Sprintf("tag%v", i)), []byte(mgr.cfg.Tag), 0660) + } if len(text) > 0 { symbolized, err := report.Symbolize(mgr.cfg.Vmlinux, text) if err != nil { |
