From a55c0058ebb614a710cb236c1b47f30aeb88ab12 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 3 Jul 2025 12:03:34 +0200 Subject: pkg/report: split crash.KMSAN --- pkg/report/crash/types.go | 8 ++++++-- pkg/report/title_to_type.go | 26 ++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) (limited to 'pkg/report') diff --git a/pkg/report/crash/types.go b/pkg/report/crash/types.go index 161950415..cae824161 100644 --- a/pkg/report/crash/types.go +++ b/pkg/report/crash/types.go @@ -23,7 +23,10 @@ const ( KCSAN = Type("KCSAN") KCSANDataRace = Type("DATARACE") KFENCE = Type("KFENCE") - KMSAN = Type("KMSAN") + KMSANInfoLeak = Type("KMSAN-INFO-LEAK") + KMSANUninitValue = Type("KMSAN-UNINIT-VALUE") + KMSANUnknown = Type("KMSAN-UNKNOWN") + KMSANUseAfterFreeRead = Type("KMSAN-USE-AFTER-FREE-READ") LockdepBug = Type("LOCKDEP") MemoryLeak = Type("LEAK") MemorySafetyBUG = Type("MEMORY_SAFETY_BUG") @@ -52,7 +55,8 @@ func (t Type) IsKASAN() bool { } func (t Type) IsKMSAN() bool { - return t == KMSAN + return slices.Contains([]Type{ + KMSANUninitValue, KMSANInfoLeak, KMSANUseAfterFreeRead, KMSANUnknown}, t) } func (t Type) IsKCSAN() bool { diff --git a/pkg/report/title_to_type.go b/pkg/report/title_to_type.go index 5dc332cd2..fc87e4069 100644 --- a/pkg/report/title_to_type.go +++ b/pkg/report/title_to_type.go @@ -11,6 +11,29 @@ var titleToType = []struct { includePrefixes []string crashType crash.Type }{ + { + includePrefixes: []string{ + "KMSAN: uninit-value", + }, + crashType: crash.KMSANUninitValue, + }, + { + includePrefixes: []string{ + // keep-sorted start + "KMSAN: kernel-infoleak-after-free", + "KMSAN: kernel-usb-infoleak-after-free", + "KMSAN: use-after-free", + // keep-sorted end + }, + crashType: crash.KMSANUseAfterFreeRead, + }, + { + includePrefixes: []string{ + "KMSAN: kernel-infoleak", + "KMSAN: kernel-usb-infoleak", + }, + crashType: crash.KMSANInfoLeak, + }, { includePrefixes: []string{ // keep-sorting start @@ -52,7 +75,6 @@ var titleToType = []struct { }, crashType: crash.KASANInvalidFree, }, - { includePrefixes: []string{ "KASAN: slab-use-after-free Read", @@ -222,7 +244,7 @@ var titleToType = []struct { }, { includePrefixes: []string{"KMSAN: "}, - crashType: crash.KMSAN, + crashType: crash.KMSANUnknown, }, { includePrefixes: []string{"UBSAN: "}, -- cgit mrf-deployment