159 Commits

Author SHA1 Message Date
Dmitry Vyukov
fd5157bebf pkg/report: sanitize titles better
Strip non-printable characters from titles.
Trim whitespaces on both ends.
Replace tabs with spaces.
Remove duplicate spaces.
Reduce max title length.
2018-04-24 19:17:07 +02:00
Dmitry Vyukov
33424b08c3 pkg/report: more corrupted report detection 2018-04-24 13:23:01 +02:00
Dmitry Vyukov
8b9a3f2c76 pkg/report: add some example arm crashes 2018-04-20 20:14:10 +02:00
Dmitry Vyukov
19af2a1b35 pkg/report: coarsen "unregister_netdevice" title
This leads to unbounded number of bug reports as syzkaller
can generate new device names dynamically.
Exclude actual device name from title.
2018-04-19 13:58:34 +02:00
Dmitry Vyukov
2199644490 pkg/report: reformat code 2018-04-18 09:23:00 +02:00
Dmitry Vyukov
85d38101ef pkg/report: ignore pkg/host debug output 2018-04-16 21:23:32 +02:00
Dmitry Vyukov
61155cf882 pkg/report: filter out more corrupted reports due to fault injection 2018-04-16 14:01:05 +02:00
Dmitry Vyukov
7a67784ca8 pkg/report: detect hangs in unregister_netdevice
Add special report format for hangs in unregister_netdevice.
And support new format of lockdep reports (otherwise they all
are marked as corrupted).
2018-04-13 17:44:45 +02:00
Dmitry Vyukov
b9f655072c pkg/report: fix typo in test failure message 2018-04-09 17:32:39 +02:00
Dmitry Vyukov
3fdee3b005 pkg/report: improve corrupted report detection
1. If we see should_failslab frames during report parsing,
   that's a corrupted report with intermixed frames from
   fault injection stack.
2. If we matched report title and this report should contains
   a guilty stack frame, but we failed to extract any frame,
   consider it as corrupted.

New tests added. Also one of the old tests is fixed.
2018-04-09 14:19:51 +02:00
Dmitry Vyukov
d70ffd1a2b pkg/report: strip "panic_on_warn set" more aggressively
KMSAN reports can be short, but still include full stack.
The added test is only 28 lines, so reduce the threshold from 40 to 25 lines.
2018-04-07 15:28:34 +02:00
Dmitry Vyukov
7606c2ac04 pkg/report: don't blame kcov
kcov frame can be present in rcu stalls, ignore it.
2018-04-06 17:24:28 +02:00
Dmitry Vyukov
372799e446 pkg/report: skip list functions during function extraction
List functions are very generic and we see lots of different
bug merged into "bug-type in list_function".
2018-04-01 12:23:00 +02:00
Dmitry Vyukov
1b0214295f pkg/report: detect corrupted task hung reports 2018-04-01 12:07:10 +02:00
Dmitry Vyukov
327060ba9b pkg/report: add few KMSAN report examples 2018-03-26 15:08:10 +02:00
Dmitry Vyukov
7e7d7ed26a pkg/report: add another test 2018-03-19 11:05:40 +01:00
Dmitry Vyukov
36d1c4540a all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
2018-03-08 18:48:26 +01:00
Dmitry Vyukov
7166783e9b pkg/report: fix crash during output parsing
The test case causes rep.StartPos == secondReportPos,
which then makes extraction of description fail,
because report is empty.
2018-03-08 10:17:07 +01:00
Dmitry Vyukov
a5e765400b pkg/report: improve invalid-free format and ignore more mutex-related functions 2018-03-07 13:40:36 +01:00
Dmitry Vyukov
c9af7e5fda pkg/report: improve KASAN report parsing
The problem is with "BUG: KASAN: (.*)" match which matches
just anything however much it is corrupted.
Mark this match as corrupted.
2018-03-06 19:15:44 +01:00
Dmitry Vyukov
5abac1920e pkg/report: add format for "workqueue leaked lock or atomic" crashes 2018-02-20 11:21:33 +01:00
Dmitry Vyukov
d9222fc03a pkg/report: improve ODEBUG bug reports 2018-02-19 21:48:20 +01:00
Dmitry Vyukov
77ed06bf16 pkg/report: skip mm/util.c in guilty files 2018-02-14 20:17:11 +01:00
Dmitry Vyukov
88bc17df05 pkg/report: improve corrupted report detection
Detect informational kernel reports that are not bugs in itself,
but contain stack traces. If we see them in the middle of another
report, we know stacks are intermixed and the report is potentially
corrupted.
2018-02-12 11:26:51 +01:00
Dmitry Vyukov
4e9b726d97 pkg/report: harden more against corrupted reports 2018-02-10 13:35:21 +01:00
Dmitry Vyukov
7d9727902f pkg/report: better titles for some kmalloc bugs 2018-02-10 12:33:20 +01:00
Dmitry Vyukov
9fb5ec4367 pkg/report: special-case extraction of guilty file for rcu stalls 2018-02-07 14:22:10 +01:00
Dmitry Vyukov
d2473bc545 pkg/report: improve guilty frame extraction
1. Make extractStackFrame more picky about stray frames.
This fixes some TODO's in tests where we matched completley
unrelated frames printed by another task.

2. Extract KASAN guilty frame from report header
if the frame should not be skipped (e.g. not __lock_acquire).
This makes parsing more tolerant to corrupted reports.
2018-02-07 13:46:35 +01:00
Dmitry Vyukov
f34079dbcf pkg/report: detect when several reports are intermixed
If there are more than one report, detect where the second
report starts and extract description only from the first report.
There are too many cases where several reports gets intermixed
and as the result we extract bogus description.
2018-02-07 09:41:12 +01:00
Dmitry Vyukov
66c15deb7a pkg/report: fix KASAN report parsing
We did not skip kasan_check_read.
Also don't let stack parsing to silently sink to another stack trace.
2018-02-06 15:29:56 +01:00
Dmitry Vyukov
645ce5da79 pkg/report: improve report titles
1. Replace stacktraceRe with custom code which is more flexible.
stacktraceRe stumbled on any unrelated lines and
could not properly parse truncated stacks.

2. Match report regexp earlier.
If we match simler title regexp, but don't match
report regexp or fail to parse stack trace, the report is corrupted.
This eliminates lots of duplicate corrupted oops entries,
which were there only because we had complex regexp's in titles.

3. Ignore low-level frames during stack parsing.
E.g. we never want to report a GPF in lock_acquire or memcpy
(somewhat similar to what we do for guilty files).

4. Add a bunch of specialized formats for WARNINGs.
There is number of generic debugging facilities (like ODEBUG,
debug usercopy, kobject, refcount_t, etc), and the bug
is never in these facilities, it's in the caller instead.

5. Improve some other oops formats.

6. Add a bunch of additional tests.

This resolves most of TODOs in tests.
Fixes #515
2018-02-06 14:44:03 +01:00
Dmitry Vyukov
e525e980ea pkg/report: add more TODO cases 2018-02-01 15:49:05 +01:00
Dmitry Vyukov
1d18b11287 pkg/report: fix guilty file regexps 2018-01-25 10:57:31 +01:00
Dmitry Vyukov
c77c36d5fa pkg/report: add another negative test case 2018-01-18 14:55:44 +01:00
Dmitry Vyukov
dcf3aa89fe pkg/report: allow up to 15 lines from "Call Trace" to first frame
Fixes a bunch of reports incorrectly marked as corrupted.
2018-01-18 10:28:07 +01:00
Dmitry Vyukov
837a69870d pkg/report: add another TODO test case 2018-01-15 20:21:30 +01:00
Dmitry Vyukov
7a4d53c30f pkg/report: add test where we fail to provide good title 2018-01-11 11:45:35 +01:00
Dmitry Vyukov
02a19b646c syz-manager: add comment explaining why we don't set corrupted for repros 2018-01-10 09:41:28 +01:00
Dmitry Vyukov
6bfc81c142 syz-fuzzer: improve kmemleak support
Don't print object size (can change from kernel to kernel
and from config to config).
Fix function extraction regexp (must be non-eager).
Account for MSECS_MIN_AGE.
Ignore some known false positives.
2018-01-09 21:24:29 +01:00
Dmitry Vyukov
1014e5506e pkg/report: ignore kernel/workqueue.c as guilty file 2018-01-08 12:56:44 +01:00
Dmitry Vyukov
93b4c6f135 pkg/report: add few more test cases where we fail 2018-01-08 12:46:51 +01:00
Dmitry Vyukov
8dc787547e pkg/report: add tests where we produce bad title 2018-01-06 17:40:52 +01:00
Dmitry Vyukov
7b28cc9307 pkg/report: add few tests where we mis-detect title/guilty file 2018-01-06 15:10:54 +01:00
Dmitry Vyukov
342feda2bf pkg/report: don't treat CONFIG_DEBUG_OBJECTS debug output as bugs 2018-01-06 14:54:09 +01:00
Dmitry Vyukov
09c8f4c00a pkg/report: add more cases where we fail to parse reports 2017-12-27 09:18:26 +01:00
Dmitry Vyukov
af9163c763 pkg/report: add test where we fail to detect guilty function 2017-12-19 13:44:03 +01:00
Dmitry Vyukov
779a655b43 pkg/report: add test where we fail to detect corrupted report 2017-12-19 13:39:14 +01:00
Dmitry Vyukov
d30c3e81eb pkg/report: add test for a bug in report parsing 2017-12-18 15:34:08 +01:00
Dmitry Vyukov
eaeccee1d7 pkg/report: add another test 2017-12-17 11:39:14 +01:00
Andrey Konovalov
06ea774dca pkg/report: fix __this_cpu_* report header call trace capture 2017-12-13 19:48:13 +01:00