Skip to content

Commit 838594b

Browse files
committed
dashboard/app: sort bugs by impact
The impact score is deducted from the title.
1 parent fd5e6e6 commit 838594b

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

dashboard/app/bug_impact_score.go

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Copyright 2025 syzkaller project authors. All rights reserved.
2+
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
3+
4+
package main
5+
6+
import "regexp"
7+
8+
// impactOrder represent an ordering of bug impact severity. The earlier
9+
// entries are considered more severe.
10+
// The regexps are matched in order, and the first match determines the
11+
// impact category. A higher index in this slice means lower impact.
12+
// The last regexp ".*" is a catch-all for unknown bugs.
13+
var impactOrder = []string{
14+
// Memory safety.
15+
`^KASAN:.*Write`,
16+
`^KASAN:.*Read`,
17+
`^WARNING: refcount bug`,
18+
`^UBSAN: array-index`,
19+
`^BUG: corrupted list`,
20+
`^BUG: unable to handle kernel paging request`,
21+
// Memory leaks.
22+
`^memory leak`,
23+
// Uninit memory use.
24+
`^KMSAN:`,
25+
// Concurrency.
26+
`^KCSAN:`,
27+
// Locking.
28+
`^BUG: sleeping function`,
29+
`^BUG: spinlock recursion`,
30+
`^BUG: using ([a-z_]+)\\(\\) in preemptible`,
31+
`^inconsistent lock state`,
32+
`^WARNING: still has locks held`,
33+
`^possible deadlock`,
34+
`^WARNING: suspicious RCU usage`,
35+
// Hangs/stalls.
36+
`^BUG: soft lockup`,
37+
`^INFO: rcu .* stall`,
38+
`^INFO: task hung`,
39+
// DoS.
40+
`^BUG:`,
41+
`^kernel BUG`,
42+
`^divide error`,
43+
`^Internal error in`,
44+
`^kernel panic:`,
45+
`^general protection fault`,
46+
`.*`,
47+
}
48+
49+
var impactREs = func() []*regexp.Regexp {
50+
res := make([]*regexp.Regexp, len(impactOrder))
51+
for i, re := range impactOrder {
52+
res[i] = regexp.MustCompile(re)
53+
}
54+
return res
55+
}()
56+
57+
// TitleToImpact converts a bug title to an impact score.
58+
// A higher score indicates a more severe impact.
59+
// The score is calculated as len(impactOrder) - position of the matching regexp.
60+
func TitleToImpact(title string) int {
61+
for i, re := range impactREs {
62+
if re.MatchString(title) {
63+
return len(impactOrder) - i
64+
}
65+
}
66+
// Should not happen due to the catch-all regexp.
67+
return 0
68+
}

dashboard/app/entities_datastore.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ func (bug *Bug) Save() ([]db.Property, error) {
280280
return db.SaveStruct(bug)
281281
}
282282

283+
func (bug *Bug) ImpactScore() int {
284+
return TitleToImpact(bug.Title)
285+
}
286+
283287
type BugDailyStats struct {
284288
Date int // YYYYMMDD
285289
CrashCount int

dashboard/app/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ type uiCommit struct {
365365
type uiBug struct {
366366
Namespace string
367367
Title string
368+
ImpactScore int
368369
NumCrashes int64
369370
NumCrashesBad bool
370371
BisectCause BisectStatus
@@ -1938,6 +1939,7 @@ func createUIBug(c context.Context, bug *Bug, state *ReportingState, managers []
19381939
uiBug := &uiBug{
19391940
Namespace: bug.Namespace,
19401941
Title: bug.displayTitle(),
1942+
ImpactScore: bug.ImpactScore(),
19411943
BisectCause: bug.BisectCause,
19421944
BisectFix: bug.BisectFix,
19431945
NumCrashes: bug.NumCrashes,

dashboard/app/templates/templates.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ <h1><a href="/{{$.Namespace}}">syzbot</a></h1>
168168
<th><a onclick="return sortTable(this, 'Kernel', textSort)" href="#">Kernel</a></th>
169169
{{end}}
170170
<th><a onclick="return sortTable(this, 'Title', textSort)" href="#">Title</a></th>
171+
<th><a onclick="return sortTable(this, 'ImpactScore', numSort)" href="#">ImpactScore</a></th>
171172
<th><a onclick="return sortTable(this, 'Repro', reproSort)" href="#">Repro</a></th>
172173
<th><a onclick="return sortTable(this, 'Cause bisect', textSort)" href="#">Cause bisect</a></th>
173174
<th><a onclick="return sortTable(this, 'Fix bisect', textSort)" href="#">Fix bisect</a></th>
@@ -202,6 +203,7 @@ <h1><a href="/{{$.Namespace}}">syzbot</a></h1>
202203
<span class="bug-label">{{link .Link .Name}}</span>
203204
{{- end}}
204205
</td>
206+
<td class="stat">{{$b.ImpactScore}}</td>
205207
<td class="stat">{{formatReproLevel $b.ReproLevel}}</td>
206208
<td class="bisect_status">{{print $b.BisectCause}}</td>
207209
<td class="bisect_status">{{print $b.BisectFix}}</td>

0 commit comments

Comments
 (0)