aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/report/linux.go')
-rw-r--r--pkg/report/linux.go119
1 files changed, 60 insertions, 59 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go
index a13a326bd..7e7ea0d89 100644
--- a/pkg/report/linux.go
+++ b/pkg/report/linux.go
@@ -15,6 +15,7 @@ import (
"time"
"github.com/google/syzkaller/pkg/osutil"
+ "github.com/google/syzkaller/pkg/report/crash"
"github.com/google/syzkaller/pkg/symbolizer"
"github.com/google/syzkaller/pkg/vcs"
"github.com/google/syzkaller/sys/targets"
@@ -639,7 +640,7 @@ func (ctx *linux) parseOpcodes(codeSlice string) (parsedOpcodes, error) {
// decompileOpcodes detects the most meaningful "Code: " lines from the report, decompiles
// them and appends a human-readable listing to the end of the report.
func (ctx *linux) decompileOpcodes(text []byte, report *Report) []byte {
- if report.Type == Hang {
+ if report.Type == crash.Hang {
// Even though Hang reports do contain the Code: section, there's no point in
// decompiling that. So just return the text.
return text
@@ -1324,7 +1325,7 @@ var linuxOopses = append([]*oops{
// These frames are present in KASAN_HW_TAGS reports.
skip: []string{"kernel_fault", "tag_check", "mem_abort", "^el1_", "^el1h_"},
},
- reportType: KASAN,
+ reportType: crash.KASAN,
},
{
title: compile("BUG: KASAN:"),
@@ -1339,18 +1340,18 @@ var linuxOopses = append([]*oops{
},
skip: []string{"slab_", "kfree", "vunmap", "vfree"},
},
- reportType: KASAN,
+ reportType: crash.KASAN,
},
{
title: compile("BUG: KASAN: ([a-z\\-]+) on address(?:.*\\n)+?.*(Read|Write) of size ([0-9]+)"),
fmt: "KASAN: %[1]v %[2]v",
- reportType: KASAN,
+ reportType: crash.KASAN,
},
{
title: compile("BUG: KASAN: (.*)"),
fmt: "KASAN: %[1]v",
corrupted: true,
- reportType: KASAN,
+ reportType: crash.KASAN,
},
{
title: compile("BUG: KMSAN: kernel-usb-infoleak"),
@@ -1390,7 +1391,7 @@ var linuxOopses = append([]*oops{
report: compile("BUG: KCSAN: (.*)"),
fmt: "KCSAN: %[1]v",
noStackTrace: true,
- reportType: DataRace,
+ reportType: crash.DataRace,
},
{
title: compile("BUG: KCSAN:"),
@@ -1485,7 +1486,7 @@ var linuxOopses = append([]*oops{
},
skip: []string{"spin_", "_lock", "_unlock"},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("BUG: soft lockup"),
@@ -1499,13 +1500,13 @@ var linuxOopses = append([]*oops{
},
extractor: linuxStallFrameExtractor,
},
- reportType: Hang,
+ reportType: crash.Hang,
},
{
title: compile("BUG: .*still has locks held!"),
report: compile("BUG: .*still has locks held!(?:.*\\n)+?.*{{PC}} +{{FUNC}}"),
fmt: "BUG: still has locks held in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("BUG: scheduling while atomic"),
@@ -1517,7 +1518,7 @@ var linuxOopses = append([]*oops{
},
skip: []string{"schedule"},
},
- reportType: AtomicSleep,
+ reportType: crash.AtomicSleep,
},
{
title: compile("BUG: lock held when returning to user space"),
@@ -1535,13 +1536,13 @@ var linuxOopses = append([]*oops{
parseStackTrace,
},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("BUG: held lock freed!"),
report: compile("BUG: held lock freed!(?:.*\\n)+?.*{{PC}} +{{FUNC}}"),
fmt: "BUG: held lock freed in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("BUG: Bad rss-counter state"),
@@ -1589,7 +1590,7 @@ var linuxOopses = append([]*oops{
parseStackTrace,
},
},
- reportType: AtomicSleep,
+ reportType: crash.AtomicSleep,
},
{
title: compile("BUG: using ([a-z_]+)\\(\\) in preemptible"),
@@ -1622,7 +1623,7 @@ var linuxOopses = append([]*oops{
"idr_get", "list_lru_init", "kasprintf", "kvasprintf",
"pcpu_create", "strdup", "strndup", "memdup"},
},
- reportType: MemoryLeak,
+ reportType: crash.MemoryLeak,
},
{
title: compile("BUG: .*stack guard page was hit at"),
@@ -1650,7 +1651,7 @@ var linuxOopses = append([]*oops{
},
skip: []string{"lock_sock", "release_sock"},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile(`BUG:[[:space:]]*(?:\n|$)`),
@@ -1669,7 +1670,7 @@ var linuxOopses = append([]*oops{
// pkg/host output in debug mode.
compile("BUG: no syscalls can create resource"),
},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("WARNING:"),
@@ -1706,26 +1707,26 @@ var linuxOopses = append([]*oops{
title: compile("WARNING: .*kernel/locking/lockdep\\.c.*lock_"),
fmt: "WARNING: locking bug in %[1]v",
stack: warningStackFmt("lock_sock", "release_sock"),
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: .*still has locks held!"),
report: compile("WARNING: .*still has locks held!(?:.*\\n)+?.*at: {{FUNC}}"),
fmt: "WARNING: still has locks held in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: Nested lock was not taken"),
fmt: "WARNING: nested lock was not taken in %[1]v",
stack: warningStackFmt(),
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: lock held when returning to user space"),
report: compile("WARNING: lock held when returning to user space(?:.*\\n)+?.*leaving the kernel with locks still held(?:.*\\n)+?.*at: (?:{{PC}} +)?{{FUNC}}"),
fmt: "WARNING: lock held when returning to user space in %[1]v",
noStackTrace: true,
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: .*mm/.*\\.c.* k?.?malloc"),
@@ -1763,13 +1764,13 @@ var linuxOopses = append([]*oops{
skip: []string{"process_one_work", "flush_workqueue",
"drain_workqueue", "destroy_workqueue"},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: possible irq lock inversion dependency detected"),
report: compile("WARNING: possible irq lock inversion dependency detected(?:.*\\n)+?.*just changed the state of lock(?:.*\\n)+?.*at: (?:{{PC}} +)?{{FUNC}}"),
fmt: "possible deadlock in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: .*-safe -> .*-unsafe lock order detected"),
@@ -1780,13 +1781,13 @@ var linuxOopses = append([]*oops{
parseStackTrace,
},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: possible recursive locking detected"),
report: compile("WARNING: possible recursive locking detected(?:.*\\n)+?.*is trying to acquire lock(?:.*\\n)+?.*at: (?:{{PC}} +)?{{FUNC}}"),
fmt: "possible deadlock in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: inconsistent lock state"),
@@ -1798,7 +1799,7 @@ var linuxOopses = append([]*oops{
parseStackTrace,
},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: suspicious RCU usage"),
@@ -1811,7 +1812,7 @@ var linuxOopses = append([]*oops{
},
skip: []string{"rcu", "kmem", "slab"},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: kernel stack regs at [0-9a-f]+ in [^ ]* has bad '([^']+)' value"),
@@ -1835,13 +1836,13 @@ var linuxOopses = append([]*oops{
parseStackTrace,
},
},
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: held lock freed!"),
report: compile("WARNING: held lock freed!(?:.*\\n)+?.*at:(?: {{PC}})? +{{FUNC}}"),
fmt: "WARNING: held lock freed in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("WARNING: kernel stack regs .* has bad 'bp' value"),
@@ -1870,7 +1871,7 @@ var linuxOopses = append([]*oops{
compile("WARNING: Unprivileged eBPF is enabled with eIBRS"),
compile(`WARNING: fbcon: Driver '(.*)' missed to adjust virtual screen size (\((?:\d+)x(?:\d+) vs\. (?:\d+)x(?:\d+)\))`),
},
- Warning,
+ crash.Warning,
},
{
[]byte("INFO:"),
@@ -1879,31 +1880,31 @@ var linuxOopses = append([]*oops{
title: compile("INFO: possible circular locking dependency detected"),
report: compile("INFO: possible circular locking dependency detected \\](?:.*\\n)+?.*is trying to acquire lock(?:.*\\n)+?.*at: {{PC}} +{{FUNC}}"),
fmt: "possible deadlock in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("INFO: possible irq lock inversion dependency detected"),
report: compile("INFO: possible irq lock inversion dependency detected \\](?:.*\\n)+?.*just changed the state of lock(?:.*\\n)+?.*at: {{PC}} +{{FUNC}}"),
fmt: "possible deadlock in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected"),
report: compile("INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected \\](?:.*\\n)+?.*is trying to acquire(?:.*\\n)+?.*at: {{PC}} +{{FUNC}}"),
fmt: "possible deadlock in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("INFO: possible recursive locking detected"),
report: compile("INFO: possible recursive locking detected \\](?:.*\\n)+?.*is trying to acquire lock(?:.*\\n)+?.*at: {{PC}} +{{FUNC}}"),
fmt: "possible deadlock in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("INFO: inconsistent lock state"),
report: compile("INFO: inconsistent lock state \\](?:.*\\n)+?.*takes(?:.*\\n)+?.*at: {{PC}} +{{FUNC}}"),
fmt: "inconsistent lock state in %[1]v",
- reportType: LockdepBug,
+ reportType: crash.LockdepBug,
},
{
title: compile("INFO: rcu_(?:preempt|sched|bh) (?:self-)?detected(?: expedited)? stall"),
@@ -1922,7 +1923,7 @@ var linuxOopses = append([]*oops{
skip: []string{"apic_timer_interrupt", "rcu"},
extractor: linuxStallFrameExtractor,
},
- reportType: Hang,
+ reportType: crash.Hang,
},
{
title: compile("INFO: trying to register non-static key"),
@@ -1958,7 +1959,7 @@ var linuxOopses = append([]*oops{
},
extractor: linuxHangTaskFrameExtractor,
},
- reportType: Hang,
+ reportType: crash.Hang,
},
{
title: compile("INFO: task .* can't die for more than .* seconds"),
@@ -1971,7 +1972,7 @@ var linuxOopses = append([]*oops{
},
skip: []string{"schedule"},
},
- reportType: Hang,
+ reportType: crash.Hang,
},
{
// This gets captured for corrupted old-style KASAN reports.
@@ -1997,7 +1998,7 @@ var linuxOopses = append([]*oops{
compile("CAM_INFO:"), // Android prints this.
compile("rmt_storage:INFO:"), // Android prints this.
},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("Unable to handle kernel"),
@@ -2016,7 +2017,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("general protection fault"),
@@ -2037,7 +2038,7 @@ var linuxOopses = append([]*oops{
[]*regexp.Regexp{
compile(`general protection fault .* error:\d+ in `),
},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("stack segment: "),
@@ -2055,7 +2056,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("Kernel panic"),
@@ -2141,7 +2142,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("PANIC: double fault"),
@@ -2157,7 +2158,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("kernel BUG"),
@@ -2199,7 +2200,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- Bug,
+ crash.Bug,
},
{
[]byte("Kernel BUG"),
@@ -2210,7 +2211,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- Bug,
+ crash.Bug,
},
{
[]byte("BUG kmalloc-"),
@@ -2221,7 +2222,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("divide error:"),
@@ -2237,7 +2238,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
// A misspelling of the above introduced in 9d06c4027f21 ("x86/entry: Convert Divide Error to IDTENTRY").
@@ -2254,7 +2255,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("invalid opcode:"),
@@ -2270,7 +2271,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("UBSAN:"),
@@ -2313,7 +2314,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UBSAN,
+ crash.UBSAN,
},
{
[]byte("Booting the kernel."),
@@ -2322,7 +2323,7 @@ var linuxOopses = append([]*oops{
title: compile("Booting the kernel."),
fmt: "unexpected kernel reboot",
noStackTrace: true,
- reportType: UnexpectedReboot,
+ reportType: crash.UnexpectedReboot,
},
},
[]*regexp.Regexp{
@@ -2331,7 +2332,7 @@ var linuxOopses = append([]*oops{
// as an invalid mount option and we detect false reboot.
compile("Parsing ELF|Decompressing Linux"),
},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("unregister_netdevice: waiting for"),
@@ -2343,7 +2344,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
// Custom vfs error printed by older versions of the kernel, see #3621.
@@ -2356,7 +2357,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
// Custom vfs error printed by older versions of the kernel, see #3621.
@@ -2369,7 +2370,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("Internal error:"),
@@ -2391,7 +2392,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("Unhandled fault:"),
@@ -2412,7 +2413,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("Alignment trap:"),
@@ -2430,7 +2431,7 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
{
[]byte("trusty: panic"),
@@ -2454,6 +2455,6 @@ var linuxOopses = append([]*oops{
},
},
[]*regexp.Regexp{},
- UnknownType,
+ crash.UnknownType,
},
}, commonOopses...)