forked from krhancoc/syzkaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openbsd.go
163 lines (159 loc) · 4.27 KB
/
openbsd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// Copyright 2018 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package report
import (
"regexp"
)
func ctorOpenbsd(cfg *config) (reporterImpl, []string, error) {
symbolizeRes := []*regexp.Regexp{
// stack
regexp.MustCompile(` at ([A-Za-z0-9_]+)\+0x([0-9a-f]+)`),
// witness
regexp.MustCompile(`#[0-9]+ +([A-Za-z0-9_]+)\+0x([0-9a-f]+)`),
}
ctx, err := ctorBSD(cfg, openbsdOopses, symbolizeRes)
if err != nil {
return nil, nil, err
}
suppressions := []string{
"panic: vop_generic_badop",
"witness: lock order reversal:\\n(.*\\n)*.*[0-9stnd]+ 0x[0-9a-f]+ inode(.*\\n)*.*lock order .* first seen at",
"panic:.*send disconnect: Broken pipe",
}
return ctx, suppressions, nil
}
var openbsdOopses = append([]*oops{
{
[]byte("cleaned vnode"),
[]oopsFormat{
{
title: compile("cleaned vnode: "),
fmt: "panic: cleaned vnode isn't",
},
},
[]*regexp.Regexp{},
},
{
[]byte("panic:"),
[]oopsFormat{
{
title: compile(`\nddb\{\d+\}> show panic(?Us:.*)[*]cpu\d+: ([^\n]+)(?Us:.*)\nddb\{\d+\}> trace`),
fmt: "panic: %[1]v",
},
{
title: compile("panic: kernel diagnostic assertion (.+) failed: file \".*/([^\"]+)"),
fmt: "assert %[1]v failed in %[2]v",
},
{
title: compile("panic: Data modified on freelist: .* previous type ([^ ]+)"),
fmt: "malloc: free list modified: %[1]v",
},
{
title: compile("panic: pool_cache_item_magic_check: ([^ ]+) cpu free list modified"),
fmt: "pool: cpu free list modified: %[1]v",
},
{
title: compile("panic: pool_do_put: ([^:]+): double pool_put"),
fmt: "pool: double put: %[1]v",
},
{
title: compile("panic: pool_do_get: ([^:]+) free list modified"),
fmt: "pool: free list modified: %[1]v",
},
{
title: compile("panic: pool_p_free: ([^:]+) free list modified"),
fmt: "pool: free list modified: %[1]v",
},
{
title: compile("panic: timeout_add: to_ticks \\(.+\\) < 0"),
fmt: "panic: timeout_add: to_ticks < 0",
},
{
title: compile("panic: attempt to execute user address {{ADDR}} in supervisor mode"),
fmt: "panic: attempt to execute user address",
},
{
title: compile("panic: unhandled af"),
fmt: "panic: unhandled af",
},
{
title: compile("panic: (kqueue|knote).* ([a-z]+ .*)"),
fmt: "kqueue: %[2]v",
},
{
title: compile("panic: receive ([0-9][a-z]*):"),
fmt: "soreceive %[1]v",
},
},
[]*regexp.Regexp{},
},
{
[]byte("lock order reversal:"),
[]oopsFormat{
{
title: compile("lock order reversal:\\n(?:.*\\n)*lock order data .* missing"),
fmt: "witness: reversal: lock order data missing",
},
{
title: compile("lock order reversal:\\n+.*1st {{ADDR}} ([^\\ ]+).*\\n.*2nd {{ADDR}} ([^\\ ]+)"),
fmt: "witness: reversal: %[1]v %[2]v",
},
},
[]*regexp.Regexp{},
},
{
[]byte("witness:"),
[]oopsFormat{
{
title: compile("witness: thread {{ADDR}} exiting with the following locks held:"),
fmt: "witness: thread exiting with locks held",
},
{
title: compile("witness: userret: returning with the following locks held:(.*\\n)+?.*sys_([a-z0-9_]+)\\+"),
fmt: "witness: userret: %[2]v",
},
{
title: compile("(witness: .*)"),
fmt: "%[1]v",
},
},
[]*regexp.Regexp{},
},
{
[]byte("uvm_fault("),
[]oopsFormat{
{
title: compile("uvm_fault\\((?:.*\\n)+?.*Stopped at[ ]+{{ADDR}}"),
report: compile("uvm_fault\\((?:.*\\n)+?.*end trace frame"),
fmt: "uvm_fault",
},
{
title: compile("uvm_fault\\((?:.*\\n)+?.*Stopped at[ ]+([^\\+]+)"),
report: compile("uvm_fault(?:.*\\n)+?.*Stopped at[ ]+([^\\+]+)(?:.*\\n)+?.*end trace frame"),
fmt: "uvm_fault: %[1]v",
},
{
title: compile("uvm_fault\\("),
fmt: "uvm_fault",
corrupted: true,
},
},
[]*regexp.Regexp{},
},
{
[]byte("kernel:"),
[]oopsFormat{
{
title: compile("kernel: page fault trap, code=0.*\\nStopped at[ ]+([^\\+]+)"),
fmt: "uvm_fault: %[1]v",
},
{
title: compile("kernel: protection fault trap, code=0.*\\nStopped at[ ]+([^\\+]+)"),
fmt: "protection_fault: %[1]v",
},
},
[]*regexp.Regexp{
compile("reorder_kernel"),
},
},
}, commonOopses...)