diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-08-22 14:25:13 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-08-22 14:08:54 +0000 |
| commit | 8ba1a581b0871089bc1d4df17c1d97f1a18357ff (patch) | |
| tree | 82781c54c353afb47afaa5dc8f2ce3193bebd53c /pkg/report/linux.go | |
| parent | 5e416b9760dc506494f60935ba8badf492728bff (diff) | |
pkg/report: extract the syz-executor info
For Linux bugs, extract the proc id and the prog id from the crash
report.
Diffstat (limited to 'pkg/report/linux.go')
| -rw-r--r-- | pkg/report/linux.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 959089d70..216fcf18e 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -189,6 +189,7 @@ func (ctx *linux) Parse(output []byte) *Report { rep.reportPrefixLen = len(rep.Report) rep.Report = append(rep.Report, report...) setReportType(rep, oops, format) + ctx.setExecutorInfo(rep) if !rep.Corrupted { rep.Corrupted, rep.CorruptedReason = ctx.isCorrupted(title, report, format) } @@ -890,6 +891,26 @@ func (ctx *linux) isCorrupted(title string, report []byte, format oopsFormat) (b return false, "" } +var syzLinuxCommRe = regexp.MustCompile(` Comm: syz\.(\d+)\.(\d+) `) + +func (ctx *linux) setExecutorInfo(rep *Report) { + match := syzLinuxCommRe.FindSubmatch(rep.Report) + if match == nil { + return + } + info := &ExecutorInfo{} + var err error + info.ProcID, err = strconv.Atoi(string(match[1])) + if err != nil { + return + } + info.ExecID, err = strconv.Atoi(string(match[2])) + if err != nil { + return + } + rep.Executor = info +} + func linuxStallFrameExtractor(frames []string) string { // During rcu stalls and cpu lockups kernel loops in some part of code, // usually across several functions. When the stall is detected, traceback |
