syzkaller-report-title
Improves syzkaller/syzbot crash report title extraction, stack-frame skipping, and guilty file attribution in pkg/report/linux.go when unrelated kernel bugs collapse into a single generic bucket (e.g., WARNING in vfree, WARNING in free_percpu). Use when fixing uninformative syzbot crash titles, adding frames to skipPatterns or warningStackFmt, adding oopsFormat rules, or updating guiltyFileIgnores.
Syzkaller Report Title & Bucketing
Fixes uninformative syzbot crash titles where generic kernel helpers (e.g., vfree, free_percpu, mark_buffer_dirty, dput, ifs_free) appear at the top of a WARNING or BUG stack trace and merge unrelated subsystem bugs into one bucket.
Workflow
1. Inspect the Crash Report(s) and Call Chain
- Read the full crash report(s) on the syzbot dashboard (
Crash reportsection) or in the bug report. - Check whether multiple distinct callers/subsystems are hitting the same generic function.
- Inspect the entire stack trace, not just the top frame:
- Identify adjacent generic helpers that would become the new top frame once the leaf is skipped (e.g., for
vfree, checkvunmap,delayed_vfree_work,kvfree; forfree_percpu, check__free_percpu; for timers,__mod_timerwas needed alongsidelock_timer_base). - Check the source file of the generic frame (e.g.,
mm/vmalloc.c,mm/percpu.c) to see ifguiltyFileIgnoresalso needs updating.
- Identify adjacent generic helpers that would become the new top frame once the leaf is skipped (e.g., for
2. Choose the Right Mechanism in pkg/report/linux.go
- Global skip (
linuxStackParams.skipPatterns):- Skips matching frames unconditionally across all crash types (
BUG,KASAN,KMSAN,WARNING, etc.). - Use only when a function is virtually never the root cause in any crash type (e.g.,
^kv?free$,^vfree$,^free_percpu$,ida_free,drop_nlink,mark_buffer_dirty,^put_device$).
- Skips matching frames unconditionally across all crash types (
- Scoped skip (
stackFmt.skip/warningStackFmt(...)):- Skips frames only for a specific
oopsFormatrule (e.g.,WARNING: .*mm/.*\.c.* k?.?mallocskips"kmalloc", "krealloc", "slab", "kmem"). - Prefer scoped
stack.skipwhen a frame is only generic for a specific warning/oops pattern, or when you want a custom title prefix likeWARNING: ... in %[1]v.
- Skips frames only for a specific
- Specific
oopsFormatbefore genericWARNING:fallbacks:linuxOopsesis matched top-to-bottom; the first matchingoopsFormatwins.- Place any specific
WARNING:rule above the genericWARNING: ... at {{SRC}} {{FUNC}}fallback entries. - If
reportfails to match (e.g., older kernel formats),pkg/reportfalls through to the simpler rules below.
- Guilty file attribution (
ctx.guiltyFileIgnoresandguiltyDir):- Fixing the title does not automatically fix
extractGuiltyFileImpl. - Verify the helper's source file is in
ctx.guiltyFileIgnores(e.g.,^mm/vmalloc\.c,^mm/percpu.*), or if it is a shared library directory likefs/iomaporfs/netfs, handle its directory depth inguiltyDir.
- Fixing the title does not automatically fix
3. Pitfalls to Avoid
- Unanchored regexes in
skipPatterns/stack.skip:extractStackFramejoins all skip entries with|into a singleregexp.MustCompileand matches substrings without implicit^/$anchors. Unanchored"vfree"will also match"delayed_vfree_work"or driver helpers containing"vfree". Always anchor exact function names (e.g.,^vfree$,^free_percpu$) unless substring matching is intentional. - Skipping only the leaf frame: Check if the next frame up is another generic wrapper with hundreds of call sites (e.g.,
__mod_timer,truncate_inode_pages_range). - Over-skipping into
"corrupted": If every frame in a stack trace matchesskipPatterns,extractStackFrameImplmarks the report"corrupted". - Silent title regressions: Adding a skip pattern can change titles for existing
pkg/report/testdata/linux/report/*cases and cause syzbot to file duplicate bugs on live trees. Always run the fullpkg/reporttest suite to catch unintended title changes. - Go
regexpmultiline & symbol matching:.does not match\nin Goregexp— use(?:.*\n)+?for multi-line patterns. Use{{FUNC}}or[a-zA-Z0-9_]+for symbol names (some start with digits or have.isra./.coldsuffixes). - Unix paths in Go: Kernel source paths always use
/. Usepath.Clean/path.Dir(notfilepath.*, which uses\on Windows hosts) or normalize withfilepath.ToSlash.
4. Add Tests
- Find the next unused numeric filename in
pkg/report/testdata/linux/report/(andpkg/report/testdata/linux/guilty/if guilty file extraction changed). - Add a test file with the expected header (
TITLE: ...orFILE: ...) followed by the crash log. - Keep testdata concise: Trim unrelated console noise and trailing register/hexdump lines after the stack trace while keeping the full warning header and
Call Trace:needed for parsing.
5. Verify & Prepare PR
- Run tests, formatter, and linter:
CI=true ./tools/syz-env go test ./pkg/report/... CI=true ./tools/syz-env make format CI=true ./tools/syz-env make lint - Commit / PR conventions:
- Summary format:
pkg/report: <lowercase description without trailing dot>(e.g.,pkg/report: skip vfree and free_percpu frames). - Include the syzbot dashboard link(s) in the PR body explaining why the frame is too generic and merges unrelated bugs.
- Summary format:
Files of this skill
This skill has no supporting files.