diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-02-04 14:06:58 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-02-06 14:44:03 +0100 |
| commit | 645ce5da79c9654c314f0d12f4c11f2a94ec156b (patch) | |
| tree | a6abcaf7f707a84852bf144f6f3e9c66aee2106c /pkg/report/testdata/linux/guilty | |
| parent | a1bc9d40ad7e062fd2867a8c3ecdd403dea2c6be (diff) | |
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
Diffstat (limited to 'pkg/report/testdata/linux/guilty')
| -rw-r--r-- | pkg/report/testdata/linux/guilty/30 | 51 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/guilty/31 | 58 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/guilty/32 | 57 |
3 files changed, 166 insertions, 0 deletions
diff --git a/pkg/report/testdata/linux/guilty/30 b/pkg/report/testdata/linux/guilty/30 new file mode 100644 index 000000000..fb4b044f6 --- /dev/null +++ b/pkg/report/testdata/linux/guilty/30 @@ -0,0 +1,51 @@ +FILE: net/ipv4/netfilter/ipt_CLUSTERIP.c + +------------[ cut here ]------------ +proc_dir_entry 'ipt_CLUSTERIP/172.20.0.170' already registered +WARNING: CPU: 1 PID: 4074 at fs/proc/generic.c:330 proc_register+0x2a4/0x370 fs/proc/generic.c:329 +Kernel panic - not syncing: panic_on_warn set ... + +CPU: 1 PID: 4074 Comm: syzkaller105937 Not tainted 4.15.0+ #221 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + __dump_stack lib/dump_stack.c:17 [inline] + dump_stack+0x194/0x257 lib/dump_stack.c:53 + panic+0x1e4/0x41c kernel/panic.c:183 + __warn+0x1dc/0x200 kernel/panic.c:547 + report_bug+0x211/0x2d0 lib/bug.c:184 + fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178 + fixup_bug arch/x86/kernel/traps.c:247 [inline] + do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296 + do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315 + invalid_op+0x22/0x40 arch/x86/entry/entry_64.S:1097 +RIP: 0010:proc_register+0x2a4/0x370 fs/proc/generic.c:329 +RSP: 0018:ffff8801da886e20 EFLAGS: 00010286 +RAX: dffffc0000000008 RBX: ffff8801d21cc7b8 RCX: ffffffff815a57ae +RDX: 0000000000000000 RSI: 1ffff1003b510d74 RDI: 1ffff1003b510d49 +RBP: ffff8801da886e70 R08: 1ffff1003b510d0b R09: 0000000000000000 +R10: ffff8801da886cd8 R11: 0000000000000000 R12: ffff8801cbf66440 +R13: dffffc0000000000 R14: ffff8801ca2fa348 R15: ffff8801cbf66501 + proc_create_data+0xf8/0x180 fs/proc/generic.c:494 + clusterip_config_init net/ipv4/netfilter/ipt_CLUSTERIP.c:250 [inline] + clusterip_tg_check+0xf9c/0x16d0 net/ipv4/netfilter/ipt_CLUSTERIP.c:488 + xt_check_target+0x22c/0x7d0 net/netfilter/x_tables.c:850 + check_target net/ipv4/netfilter/ip_tables.c:513 [inline] + find_check_entry.isra.8+0x8c8/0xcb0 net/ipv4/netfilter/ip_tables.c:554 + translate_table+0xed1/0x1610 net/ipv4/netfilter/ip_tables.c:725 + do_replace net/ipv4/netfilter/ip_tables.c:1141 [inline] + do_ipt_set_ctl+0x370/0x5f0 net/ipv4/netfilter/ip_tables.c:1675 + nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] + nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 + ip_setsockopt+0x97/0xa0 net/ipv4/ip_sockglue.c:1259 + sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4104 + sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 + SYSC_setsockopt net/socket.c:1849 [inline] + SyS_setsockopt+0x189/0x360 net/socket.c:1828 + entry_SYSCALL_64_fastpath+0x29/0xa0 +RIP: 0033:0x44afa9 +RSP: 002b:00007f43f70edce8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 +RAX: ffffffffffffffda RBX: 00000000006e0c3c RCX: 000000000044afa9 +RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000004 +RBP: 00000000006e0c38 R08: 0000000000000348 R09: 0000000000000000 +R10: 0000000020013c90 R11: 0000000000000246 R12: 0000000000000000 +R13: 00007ffe194fe84f R14: 00007f43f70ee9c0 R15: 0000000000000005 diff --git a/pkg/report/testdata/linux/guilty/31 b/pkg/report/testdata/linux/guilty/31 new file mode 100644 index 000000000..074c11c5b --- /dev/null +++ b/pkg/report/testdata/linux/guilty/31 @@ -0,0 +1,58 @@ +FILE: net/bridge/br_if.c + +------------[ cut here ]------------ +WARNING: CPU: 1 PID: 3485 at lib/kobject.c:244 kobject_add_internal+0x3f6/0xbc0 lib/kobject.c:242 +Kernel panic - not syncing: panic_on_warn set ... + +CPU: 1 PID: 3485 Comm: syz-executor6 Not tainted 4.14.0-rc4+ #80 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + __dump_stack lib/dump_stack.c:16 [inline] + dump_stack+0x194/0x257 lib/dump_stack.c:52 + panic+0x1e4/0x417 kernel/panic.c:181 + __warn+0x1c4/0x1d9 kernel/panic.c:542 + report_bug+0x211/0x2d0 lib/bug.c:183 + fixup_bug+0x40/0x90 arch/x86/kernel/traps.c:178 + do_trap_no_signal arch/x86/kernel/traps.c:212 [inline] + do_trap+0x260/0x390 arch/x86/kernel/traps.c:261 + do_error_trap+0x120/0x390 arch/x86/kernel/traps.c:298 + do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:311 + invalid_op+0x18/0x20 arch/x86/entry/entry_64.S:905 +RIP: 0010:kobject_add_internal+0x3f6/0xbc0 lib/kobject.c:242 +RSP: 0018:ffff8801bf816900 EFLAGS: 00010282 +RAX: 0000000000000040 RBX: ffff8801c09b4620 RCX: 0000000000000000 +RDX: 0000000000000040 RSI: ffffffff8158d38e RDI: ffffed0037f02d14 +RBP: ffff8801bf8169f8 R08: ffff8801bf816070 R09: 0000000000000000 +R10: 0000000000000000 R11: 0000000000000000 R12: 1ffff10037f02d26 +R13: 00000000fffffff4 R14: ffff8801cb9b0b30 R15: ffff8801cd01c000 + kobject_add_varg lib/kobject.c:366 [inline] + kobject_init_and_add+0xf9/0x150 lib/kobject.c:438 + br_add_if+0x786/0x1990 net/bridge/br_if.c:533 + br_add_slave+0x29/0x30 net/bridge/br_device.c:349 + do_set_master+0x19c/0x1f0 net/core/rtnetlink.c:1986 + do_setlink+0xa98/0x38e0 net/core/rtnetlink.c:2119 + rtnl_newlink+0xf0d/0x1a40 net/core/rtnetlink.c:2661 + rtnetlink_rcv_msg+0x733/0x1090 net/core/rtnetlink.c:4301 + netlink_rcv_skb+0x216/0x440 net/netlink/af_netlink.c:2409 + rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4313 + netlink_unicast_kernel net/netlink/af_netlink.c:1273 [inline] + netlink_unicast+0x4e8/0x6f0 net/netlink/af_netlink.c:1299 + netlink_sendmsg+0xa4a/0xe70 net/netlink/af_netlink.c:1862 + sock_sendmsg_nosec net/socket.c:633 [inline] + sock_sendmsg+0xca/0x110 net/socket.c:643 + sock_write_iter+0x320/0x5e0 net/socket.c:912 + call_write_iter include/linux/fs.h:1770 [inline] + do_iter_readv_writev+0x531/0x7f0 fs/read_write.c:673 + do_iter_write+0x15a/0x540 fs/read_write.c:952 + vfs_writev+0x18a/0x340 fs/read_write.c:997 + do_writev+0xfc/0x2a0 fs/read_write.c:1032 + SYSC_writev fs/read_write.c:1105 [inline] + SyS_writev+0x27/0x30 fs/read_write.c:1102 + entry_SYSCALL_64_fastpath+0x1f/0xbe +RIP: 0033:0x4520a9 +RSP: 002b:00007f4633db3c08 EFLAGS: 00000216 ORIG_RAX: 0000000000000014 +RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 00000000004520a9 +RDX: 0000000000000001 RSI: 00000000205d9000 RDI: 0000000000000005 +RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 +R10: 0000000000000000 R11: 0000000000000216 R12: 00000000004b6c37 +R13: 00007f4633db3b48 R14: 00000000004b6c47 R15: 0000000000000000 diff --git a/pkg/report/testdata/linux/guilty/32 b/pkg/report/testdata/linux/guilty/32 new file mode 100644 index 000000000..15420b982 --- /dev/null +++ b/pkg/report/testdata/linux/guilty/32 @@ -0,0 +1,57 @@ +FILE: net/tipc/name_table.c + +list_del corruption. prev->next should be 00000000bc6553ca, but was 0000000038fa8131 +------------[ cut here ]------------ +kernel BUG at lib/list_debug.c:53! +invalid opcode: 0000 [#1] SMP KASAN +Dumping ftrace buffer: + (ftrace buffer empty) +Modules linked in: +CPU: 1 PID: 3200 Comm: syz-executor4 Not tainted 4.15.0-rc8+ #264 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +RIP: 0010:__list_del_entry_valid+0xef/0x150 lib/list_debug.c:51 +RSP: 0018:ffff8801be95eb20 EFLAGS: 00010286 +RAX: 0000000000000054 RBX: ffff8801d359f240 RCX: 0000000000000000 +RDX: 0000000000000054 RSI: 1ffff10039af2dca RDI: ffffed0037d2bd58 +RBP: ffff8801be95eb38 R08: 1ffff10037d2bcfc R09: 0000000000000000 +R10: ffff8801be95ea00 R11: 0000000000000000 R12: ffff8801d50e4900 +R13: ffff8801be95ecd8 R14: ffff8801c29ac860 R15: ffff8801bd76aa80 +FS: 00007f70eee26700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 00000000010bad18 CR3: 0000000006822006 CR4: 00000000001606e0 +Call Trace: + __list_del_entry include/linux/list.h:117 [inline] + list_del_init include/linux/list.h:159 [inline] + tipc_nametbl_unsubscribe+0x318/0x990 net/tipc/name_table.c:851 + tipc_subscrb_subscrp_delete+0x1e9/0x460 net/tipc/subscr.c:208 + tipc_subscrb_delete net/tipc/subscr.c:238 [inline] + tipc_subscrb_release_cb+0x17/0x30 net/tipc/subscr.c:316 + tipc_close_conn+0x171/0x270 net/tipc/server.c:204 + tipc_topsrv_kern_unsubscr+0x213/0x340 net/tipc/server.c:532 + tipc_group_delete+0x2c0/0x3d0 net/tipc/group.c:206 + tipc_sk_leave+0x10b/0x200 net/tipc/socket.c:2780 + tipc_release+0x154/0xfe0 net/tipc/socket.c:575 + sock_release+0x8d/0x1e0 net/socket.c:602 + sock_close+0x16/0x20 net/socket.c:1131 + __fput+0x327/0x7e0 fs/file_table.c:210 + ____fput+0x15/0x20 fs/file_table.c:244 + task_work_run+0x199/0x270 kernel/task_work.c:113 + exit_task_work include/linux/task_work.h:22 [inline] + do_exit+0x9bb/0x1ad0 kernel/exit.c:865 + do_group_exit+0x149/0x400 kernel/exit.c:968 + get_signal+0x73f/0x16c0 kernel/signal.c:2335 + do_signal+0x90/0x1eb0 arch/x86/kernel/signal.c:809 + exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158 + prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] + syscall_return_slowpath+0x490/0x550 arch/x86/entry/common.c:264 + entry_SYSCALL_64_fastpath+0x9e/0xa0 +RIP: 0033:0x452df9 +RSP: 002b:00007f70eee25c88 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca +RAX: 0000000000000001 RBX: 000000000071bea0 RCX: 0000000000452df9 +RDX: 0000000000000000 RSI: 0000000000000001 RDI: 000000000071becc +RBP: 0000000000000573 R08: 0000000000000000 R09: 0000000000000000 +R10: 0000000000000010 R11: 0000000000000246 R12: 0000000000000001 +R13: 0000000000000014 R14: 00007f70eee266d4 R15: ffffffffffffffff +Code: 4c 89 e2 48 c7 c7 c0 fb e0 85 e8 95 26 fe fe 0f 0b 48 c7 c7 20 fc e0 85 e8 87 26 fe fe 0f 0b 48 c7 c7 80 fc e0 85 e8 79 26 fe fe <0f> 0b 48 c7 c7 e0 fc e0 85 e8 6b 26 fe fe 0f 0b 48 89 df 48 89 +RIP: __list_del_entry_valid+0xef/0x150 lib/list_debug.c:51 RSP: ffff8801be95eb20 +---[ end trace 0c495e0cee371de9 ]--- |
