From f8f0147ff731cd582e6222d953d076bb8cf4c52b Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Wed, 8 May 2019 15:51:59 +0200 Subject: pkg/report: don't mark unknown oopses as corrupted --- pkg/report/linux.go | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index a0f7656f9..8e56367a9 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -508,6 +508,10 @@ func (ctx *linux) isCorrupted(title string, report []byte, format oopsFormat) (b return true, "title matches corrupted regexp" } } + // If the report hasn't matched any of the oops titles, don't mark it as corrupted. + if format.title == nil { + return false, "" + } // Check if the report contains stack trace. if !format.noStackTrace && !bytes.Contains(report, []byte("Call Trace")) && !bytes.Contains(report, []byte("backtrace")) { @@ -991,6 +995,21 @@ var linuxOopses = []*oops{ "pcpu_create", "strdup", "strndup", "memdup"}, }, }, + { + title: compile("BUG: stack guard page was hit at"), + fmt: "BUG: stack guard page was hit in %[1]v", + stack: &stackFmt{ + parts: []*regexp.Regexp{ + linuxRipFrame, + }, + }, + noStackTrace: true, + }, + { + title: compile(`BUG:[[:space:]]*(?:\n|$)`), + fmt: "BUG: corrupted", + corrupted: true, + }, }, []*regexp.Regexp{ // CONFIG_DEBUG_OBJECTS output. @@ -1123,6 +1142,11 @@ var linuxOopses = []*oops{ fmt: "WARNING: kernel stack regs has bad value", noStackTrace: true, }, + { + title: compile(`WARNING:[[:space:]]*(?:\n|$)`), + fmt: "WARNING: corrupted", + corrupted: true, + }, }, []*regexp.Regexp{ compile("WARNING: /etc/ssh/moduli does not exist, using fixed modulus"), // printed by sshd @@ -1215,6 +1239,11 @@ var linuxOopses = []*oops{ fmt: "INFO: %[1]v in %[2]v", corrupted: true, }, + { + title: compile(`INFO:[[:space:]]*(?:\n|$)`), + fmt: "INFO: corrupted", + corrupted: true, + }, }, []*regexp.Regexp{ compile("INFO: lockdep is turned off"), @@ -1363,6 +1392,16 @@ var linuxOopses = []*oops{ }, }, }, + { + title: compile("kernel BUG at (.*)"), + fmt: "kernel BUG at %[1]v", + stack: &stackFmt{ + parts: []*regexp.Regexp{ + compile("Call Trace:"), + parseStackTrace, + }, + }, + }, }, []*regexp.Regexp{}, }, -- cgit mrf-deployment