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