Commit Graph

356 Commits

Author SHA1 Message Date
Alexander Egorenkov
bc258b506d pkg: support compiler triple for 'nm' and 'addr2line'
In preparation to support big-endian architectures.
2020-06-18 19:31:40 +02:00
Andrey Konovalov
4d2d1ebee3 pkg/report: stop using questionable frames
Most likely reports without proper stack traces were caused by a bug in the
unwinder and are now fixed in 187b96db5ca7 "x86/unwind/orc: Fix
unwind_get_return_address_ptr() for inactive tasks".

Disable trying to use questionable frames for now.

Fixes #1834
2020-06-17 17:42:50 +02:00
Dmitry Vyukov
6fe5725de8 pkg/report: ingore another android debug output that looks like kernel crash 2020-06-12 08:23:36 +02:00
Dmitry Vyukov
588020678f all: use more respective language
Some terms are normalised on the technical level
but may be oppressive on a societal level.
Replace them with more technically neutral terms.
See the following doc for a longer version:
https://tools.ietf.org/id/draft-knodel-terminology-00.html
2020-06-11 23:19:34 +02:00
Dmitry Vyukov
cdf1aa4dc3 pkg/report: deduplicate code across netbsd and openbsd 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
70854cd639 .golangci.yml: enable lll for pkg/report/linux.go 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
2fcb2b5c16 .golangci.yml: enable gocognit checker
Finds too complex functions.
Similar to gocyclo, but uses somewhat different metric.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
1f837d8b35 pkg/report: improve "using smp_processor_id() in preemptible code" parsing 2020-06-04 12:16:25 +02:00
Dmitry Vyukov
a5ce5de0ae pkg/report: update "using X in preemptible code" bug 2020-06-03 12:46:37 +02:00
Dmitry Vyukov
06417ff868 pkg/report: add tests for rcu stalls in kmem_cache_alloc
I though maybe we need special handling for them:
stop at kmem_cache_alloc function. But now I am not sure.
This can also be an infinite loop which calls kmalloc/kfree.
Let's not change code for now, just fix things with tests
(this is a good representative set).
2020-06-02 17:47:56 +02:00
Andrey Konovalov
c98aaf984a pkg/report: improve report titles 2020-06-02 17:23:51 +02:00
Dmitry Vyukov
2510d1afaa pkg/report: avoid producing no guilty file
If we produce no guilty file at all, the report is mailed only to LKML,
which is mostly equivalent to mailing to nobody.
If we skip all files, return the first one.
2020-05-29 15:27:43 +02:00
m00nbsd
bd28eb9d78 pkg/report: fix kUBSan reporting on NetBSD 2020-05-24 14:34:40 +02:00
Dmitry Vyukov
50749f54cd pkg/report: add ParseAll
ParseAll returns all reports in output.
Use it in syz-symbolize.
2020-05-13 20:49:07 +02:00
Dmitry Vyukov
3d789641a3 pkg/report: add Report.SkipPos
SkipPos is what pkg/instance needs,
but also will be needed for ParseAll.
2020-05-13 20:37:26 +02:00
Dmitry Vyukov
b026d481be pkg/report: skip "rwsem" frames in task hung reports 2020-05-11 16:54:55 +02:00
Dmitry Vyukov
65a44e22ba pkg/build: find maintainers for build errors
Extract build error source file and obtain maintainers
so that we can mail the report to the right people.

Update #1667
2020-05-09 09:57:51 +02:00
Mark Johnston
cc90e4763e pkg/report: match a common pf panic 2020-04-30 16:33:09 +02:00
Dmitry Vyukov
20ed497b52 pkg/report: add compat ioctl stall anchor frames
Add new __ia32_compat_sys_ioctl anchor frame
(something seems to have been changed in compat ioctl's).
Also skip all compat_ioctl frames, it's pretty common naming
convention and it may help to avoid some dups across
compat/non-compat paths.
2020-04-19 10:26:57 +02:00
Anton Lindqvist
36b0b05078 pkg/report: make uvm_fault parsing more strict on OpenBSD
In order to avoid treating the following diagnostic printf as a panic[1]:

	vmx_mprotect_ept: uvm_fault returns 14, GPA=0x200000

[1] https://syzkaller.appspot.com/bug?id=25f3ef919bf9f5d8a89e13b1ba5fec8ca56334be
2020-04-12 13:10:26 +02:00
Dmitry Vyukov
0bbbd25447 pkg/report: fix detection of questionable frames
The previous commit "pkg/report: handle cases when whole stack is questionable"
mishandles frames that start with [PC] prefix before " ? ".
Restore that part.
2020-03-27 06:23:11 +01:00
Dmitry Vyukov
78267cec1a vm: better handle VM diagnosis output
1. Always append diagnosis output at the end.
Don't intermix it with kernel output. It's confusing and not useful.

2. Don't include diagnosis output into Report.
It's too verbose and is not the crash. Keep it only in the Output.
2020-03-21 16:30:35 +01:00
Dmitry Vyukov
a2d5b1c04d pkg/report: handle cases when whole stack is questionable
If the report is identified as corrupted because there are no frames at all,
try to re-extract using questionable frames.
This is a bit risky and may produce lots of one-off corrupted reports
at random locations. But we won't know until we deploy this...

Fixes #1216
2020-03-21 14:43:26 +01:00
Andrey Konovalov
4288d95ef6 pkg/report: improve report titles 2020-03-21 08:13:09 +01:00
Andrey Konovalov
2c31c529a9 pkg/report: improve report titles 2020-03-18 17:41:34 +01:00
Andrey Konovalov
fd69032d78 pkg/report: improve report titles 2020-03-13 07:44:53 +01:00
Andrey Konovalov
35f53e4574 pkg/report: improve report titles 2020-03-09 14:46:52 +01:00
Dmitry Vyukov
fd2a5f28eb executor: prevent "NMI handler took too long" messages
nmi_check_duration() prints "INFO: NMI handler took too long" on slow debug kernels.
It happens a lot in qemu, and the messages are frequently corrupted
(intermixed with other kernel output as they are printed from NMI)
and are not matched against the suppression in pkg/report.
This write prevents these messages from being printed.
2020-03-06 13:38:53 +01:00
Anton Lindqvist
c88c7b75a4 pkg/report: normalize soreceive report on OpenBSD
At last!
2020-02-27 20:12:33 +01:00
Kamil Rytarowski
2c36e7a75f pkg/report: Improve parsing of the UBSan reports 2020-02-22 10:06:14 +01:00
Dmitry Vyukov
93e5e33559 pkg/report: update parsing of rcu stalls in ioctls
vfs_ioctl is now inlined somethimes...
2020-02-02 12:56:15 +01:00
Dmitry Vyukov
c30117b2ac pkg/report: don't attribute deadlocks to workqueue functions
In all cases we seen deadlocks in workqueue functions are related
to the subsystem that submits work items.
2020-01-31 19:14:47 +01:00
Dmitry Vyukov
0692a5861f pkg/report: add a note about an existing suppression 2020-01-28 13:38:53 +01:00
Dmitry Vyukov
02754a8f9a tools/syz-check: check netlink policy descriptions
Overall idea of netlink checking.
Currnetly we check netlink policies for common detectable mistakes.
First, we detect what looks like a netlink policy in our descriptions
(these are structs/unions only with nlattr/nlnext/nlnetw fields).
Then we find corresponding symbols (offset/size) in vmlinux using nm.
Then we read elf headers and locate where these symbols are in the rodata section.
Then read in the symbol data, which is an array of nla_policy structs.
These structs allow to easily figure out type/size of attributes.
Finally we compare our descriptions with the kernel policy description.

Update #590
2020-01-22 12:19:53 +01:00
Dmitry Vyukov
d2557fb5ca pkg/report: treat nfnetlink_rcv_msg as anchor frame
There is tremendous branching after that frame to all
existing netlink callbacks which are effectively completely
different syscalls.
2020-01-20 10:57:28 +01:00
Jann Horn
069a5a4486 pkg/report: add pattern for Linux #SS faults
On X86-64, dereferencing a non-canonical address normally causes a #GP, for
which syzkaller already has a pattern. However, if the base register of the
non-canonical address is RBP (which can happen in builds that use RBP as a
general-purpose register because they don't use frame pointer unwinding),
#SS is thrown instead, for which syzkaller did not yet have a pattern.

To see this kind of fault, you can insert the following code in
kernel_init() after the call to rcu_end_inkernel_boot():

	asm volatile(
		"movabs $0x8000000000000000, %rbp\n\t"
		"movq (%rbp), %rax\n\t"
		"ud2\n\t"
	);

Linux prints a different error message for #SS, so add that error message
to syzkaller's list of patterns.
2020-01-15 16:06:40 +01:00
Andrew Turner
fa12bd3c2e pkg/report: Add the calling function to sx reports
These can fail in many functions, include the calling function in
the report
2020-01-14 19:55:46 +01:00
Andrey Konovalov
a20859865e pkg/report: add more ignored frames 2020-01-07 16:02:48 +01:00
Anton Lindqvist
53430d9719 pkg/report: normalize kqueue_check report on OpenBSD 2020-01-06 20:37:03 +01:00
Anton Lindqvist
9dcc1191cb pkg/report: normalize unhandled af report on OpenBSD 2020-01-03 08:37:12 +01:00
Dmitry Vyukov
f9f80dd437 pkg/report: use --git-min-percent=15 for get_maintainer.pl
Update #1441
2019-12-10 12:35:10 +01:00
Anton Lindqvist
b31eda3df8 pkg/report: normalize yet another free list modified report on OpenBSD 2019-12-09 11:09:14 +01:00
Siddharth M
12c3b6cd9a pkg/build: add support to build the NetBSD kernel with KMSan
* Initial KMSan commit
* pkg/buil: kmsan cleanup
* pkg/build: Modify the logic slightly
2019-12-06 11:28:19 +01:00
Dmitry Vyukov
4fb74474cf pkg/report: fix guilty file extraction in presence of rcu stalls
The the added test for exception from exception corner case.

"BUG: spinlock lockup" fails to respect panic_on_warn and panic
after printing report (though, it's a BUG already, so it should
have been paniced even without panic_on_warn).
As the result we got "spinlock lockup" followed by "rcu stall" report.
And we have that special exception for rcu stalls b/c for them
the most of the report is irrelevant up to apic_timer_interrupt frame.
The code did not expect this weird double-report case and skipped
everything up to apic_timer_interrupt, though it's actually
a lockup in netfilter code.
2019-12-05 12:14:58 +01:00
Andrey Konovalov
036f0b1e8d pkg/report: improve reports titles
Ignore kobject_put in stack frames.
2019-12-05 12:03:11 +01:00
Andrey Konovalov
659d8b8568 pkg/report: improve report titles 2019-11-29 13:13:04 +01:00
Dmitry Vyukov
736169d38b pkg/report: add few more UBSAN reports
Update #1523
2019-11-29 10:45:55 +01:00
Dmitry Vyukov
76357d6f89 pkg/report: update UBSAN report parsing
Update #1523
2019-11-28 14:07:19 +01:00
Jann Horn
432c7650d5 pkg/report: generalize general protection fault pattern
An upcoming patch for Linux will change the error reporting pattern for
general protection faults such that the colon doesn't necessarily come
immediately after the string "general protection fault" (see
https://lore.kernel.org/lkml/20191118142144.GC6363@zn.tnic/).
Change the pattern in syzkaller before that happens.

Note that this is not necessarily the final format; in particular, the
ordering of the KASAN note and the "general protection fault" line might
swap.
2019-11-19 08:07:30 +01:00
David Pursell
79248ee88b sys/fuchsia: remove deprecated exception APIs
The port-based exception APIs have been deprecated on Fuchsia and will
be removed shortly. Delete them from the syscall definitions and
modify the Fuchsia executor to use the new channel-based APIs instead.
2019-11-14 16:21:01 -08:00