diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-07-02 17:03:02 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-07-03 08:51:28 +0000 |
| commit | 22d2aa64dae7c92bf2737c001e8a96146b8a693d (patch) | |
| tree | 6aa239f4d42b14f7d38ba278a205c275dee1655e /pkg/report | |
| parent | 115ceea74e11fcf2b7ad5717ef91980f501cc81b (diff) | |
pkg/report: split crash.KASAN into parts
We want to prioritize KASAN bugs differently.
Diffstat (limited to 'pkg/report')
| -rw-r--r-- | pkg/report/crash/types.go | 42 | ||||
| -rw-r--r-- | pkg/report/title_to_type.go | 58 |
2 files changed, 82 insertions, 18 deletions
diff --git a/pkg/report/crash/types.go b/pkg/report/crash/types.go index ad550fa08..161950415 100644 --- a/pkg/report/crash/types.go +++ b/pkg/report/crash/types.go @@ -3,27 +3,34 @@ package crash +import "slices" + type Type string const ( UnknownType = Type("") // keep-sorted start - AtomicSleep = Type("ATOMIC_SLEEP") - Bug = Type("BUG") - DoS = Type("DoS") - Hang = Type("HANG") - KASAN = Type("KASAN") - KCSAN = Type("KCSAN") - KCSANDataRace = Type("DATARACE") - KFENCE = Type("KFENCE") - KMSAN = Type("KMSAN") - LockdepBug = Type("LOCKDEP") - MemoryLeak = Type("LEAK") - MemorySafetyBUG = Type("MEMORY_SAFETY_BUG") - MemorySafetyUBSAN = Type("MEMORY_SAFETY_UBSAN") - MemorySafetyWARNING = Type("MEMORY_SAFETY_WARNING") - UBSAN = Type("UBSAN") - Warning = Type("WARNING") + AtomicSleep = Type("ATOMIC_SLEEP") + Bug = Type("BUG") + DoS = Type("DoS") + Hang = Type("HANG") + KASANInvalidFree = Type("KASAN-INVALID-FREE") + KASANOther = Type("KASAN-OTHER") + KASANRead = Type("KASAN-READ") + KASANUseAfterFreeRead = Type("KASAN-USE-AFTER-FREE-READ") + KASANUseAfterFreeWrite = Type("KASAN-USE-AFTER-FREE-WRITE") + KASANWrite = Type("KASAN-WRITE") + KCSAN = Type("KCSAN") + KCSANDataRace = Type("DATARACE") + KFENCE = Type("KFENCE") + KMSAN = Type("KMSAN") + LockdepBug = Type("LOCKDEP") + MemoryLeak = Type("LEAK") + MemorySafetyBUG = Type("MEMORY_SAFETY_BUG") + MemorySafetyUBSAN = Type("MEMORY_SAFETY_UBSAN") + MemorySafetyWARNING = Type("MEMORY_SAFETY_WARNING") + UBSAN = Type("UBSAN") + Warning = Type("WARNING") // keep-sorted end LostConnection = Type("LOST_CONNECTION") SyzFailure = Type("SYZ_FAILURE") @@ -40,7 +47,8 @@ func (t Type) String() string { type TypeGroupPred func(Type) bool func (t Type) IsKASAN() bool { - return t == KASAN + return slices.Contains([]Type{ + KASANRead, KASANWrite, KASANUseAfterFreeRead, KASANUseAfterFreeWrite, KASANInvalidFree, KASANOther}, t) } func (t Type) IsKMSAN() bool { diff --git a/pkg/report/title_to_type.go b/pkg/report/title_to_type.go index 61c7b6d9d..5dc332cd2 100644 --- a/pkg/report/title_to_type.go +++ b/pkg/report/title_to_type.go @@ -14,6 +14,62 @@ var titleToType = []struct { { includePrefixes: []string{ // keep-sorting start + "KASAN: global-out-of-bounds Write", + "KASAN: null-ptr-deref Write", + "KASAN: out-of-bounds Write", + "KASAN: slab-out-of-bounds Write", + "KASAN: stack-out-of-bounds Write", + "KASAN: user-memory-access Write", + "KASAN: vmalloc-out-of-bounds Write", + "KASAN: wild-memory-access Write", + // keep-sorting end + }, + crashType: crash.KASANWrite, + }, + { + includePrefixes: []string{ + // keep-sorting start + "KASAN: global-out-of-bounds Read", + "KASAN: invalid-access Read", + "KASAN: null-ptr-deref Read", + "KASAN: out-of-bounds Read", + "KASAN: slab-out-of-bounds Read", + "KASAN: slab-out-of-bounds", // Read/Write is not clear. It is at least Read. + "KASAN: stack-out-of-bounds Read", + "KASAN: stack-out-of-bounds", // Read/Write is not clear. It is at least Read. + "KASAN: unknown-crash Read", + "KASAN: user-memory-access Read", + "KASAN: vmalloc-out-of-bounds Read", + "KASAN: wild-memory-access Read", + // keep-sorting end + }, + crashType: crash.KASANRead, + }, + { + includePrefixes: []string{ + "KASAN: double-free or invalid-free", + "KASAN: invalid-free", + }, + crashType: crash.KASANInvalidFree, + }, + + { + includePrefixes: []string{ + "KASAN: slab-use-after-free Read", + "KASAN: use-after-free Read", + }, + crashType: crash.KASANUseAfterFreeRead, + }, + { + includePrefixes: []string{ + "KASAN: slab-use-after-free Write", + "KASAN: use-after-free Write", + }, + crashType: crash.KASANUseAfterFreeWrite, + }, + { + includePrefixes: []string{ + // keep-sorting start "BUG: corrupted list", "BUG: unable to handle kernel paging request", // keep-sorting end @@ -158,7 +214,7 @@ var titleToType = []struct { }, { includePrefixes: []string{"KASAN: "}, - crashType: crash.KASAN, + crashType: crash.KASANOther, }, { includePrefixes: []string{"KFENCE: "}, |
