diff options
| author | Hrutvik Kanabar <hrutvik@google.com> | 2022-09-30 10:52:11 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2022-09-30 15:43:22 +0200 |
| commit | 5e8ac358946b8898e30bb3d9642a1ce5e5b15a5a (patch) | |
| tree | cf002e7e7342f9db67be6710e1a81247c478a274 /pkg/report/testdata/linux | |
| parent | 45fd7169d5def6b5bc3fb4ff028ba831d1ffa063 (diff) | |
pkg/report: improve guilty file identification
Previously we would pick the first non-ignored file. Now instead,
continue searching the stack trace for more specific files.
A "more specific" file wrt the first non-ignored file has:
- the same directory prefix
- a deeper directory nesting
E.g. `fs/ntfs3/*.c` is "more specific" than "fs/*.c".
We search for the most specific file (i.e. the deepest nesting), and
take the first most specific if there are multiple files with the same
nesting.
This commit also adds three tests for this behaviour, taken from
recent `syzbot` bugs which identified the wrong file. Now the desired
file is identified.
Only one existing test shows different output with the new behaviour.
Updates #3393.
Diffstat (limited to 'pkg/report/testdata/linux')
| -rw-r--r-- | pkg/report/testdata/linux/guilty/36 | 2 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/guilty/54 | 37 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/guilty/55 | 82 | ||||
| -rw-r--r-- | pkg/report/testdata/linux/guilty/56 | 61 |
4 files changed, 181 insertions, 1 deletions
diff --git a/pkg/report/testdata/linux/guilty/36 b/pkg/report/testdata/linux/guilty/36 index dc6a587a1..f13e2d144 100644 --- a/pkg/report/testdata/linux/guilty/36 +++ b/pkg/report/testdata/linux/guilty/36 @@ -1,4 +1,4 @@ -FILE: sound/core/pcm_native.c +FILE: sound/core/oss/pcm_oss.c syz-executor1 (6140) used greatest stack depth: 11720 bytes left INFO: rcu_sched self-detected stall on CPU diff --git a/pkg/report/testdata/linux/guilty/54 b/pkg/report/testdata/linux/guilty/54 new file mode 100644 index 000000000..8781a1e87 --- /dev/null +++ b/pkg/report/testdata/linux/guilty/54 @@ -0,0 +1,37 @@ +FILE: fs/ntfs3/super.c + +loop0: detected capacity change from 0 to 8226 +Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: writeback_single_inode+0x8e7/0x8f0 +CPU: 0 PID: 10213 Comm: syz-executor262 Not tainted 6.0.0-rc7-syzkaller-00081-gc3e0e1e23c70 #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 +Call Trace: + <TASK> + __dump_stack lib/dump_stack.c:88 [inline] + dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 + panic+0x2d6/0x715 kernel/panic.c:274 + __stack_chk_fail+0x12/0x20 kernel/panic.c:706 + writeback_single_inode+0x8e7/0x8f0 + write_inode_now+0x1cd/0x260 fs/fs-writeback.c:2723 + iput_final fs/inode.c:1735 [inline] + iput+0x3e6/0x760 fs/inode.c:1774 + ntfs_fill_super+0x3af3/0x42a0 fs/ntfs3/super.c:1190 + get_tree_bdev+0x400/0x620 fs/super.c:1323 + vfs_get_tree+0x88/0x270 fs/super.c:1530 + do_new_mount+0x289/0xad0 fs/namespace.c:3040 + do_mount fs/namespace.c:3383 [inline] + __do_sys_mount fs/namespace.c:3591 [inline] + __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3568 + do_syscall_x64 arch/x86/entry/common.c:50 [inline] + do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 + entry_SYSCALL_64_after_hwframe+0x63/0xcd +RIP: 0033:0x7f5a7dd5549a +Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 98 03 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 +RSP: 002b:00007ffedfc06378 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5 +RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f5a7dd5549a +RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffedfc06390 +RBP: 00007ffedfc06390 R08: 00007ffedfc063d0 R09: 00005555563ee2c0 +R10: 0000000000000000 R11: 0000000000000286 R12: 0000000000000004 +R13: 00007ffedfc063d0 R14: 0000000000000015 R15: 0000000020000db8 + </TASK> +Kernel Offset: disabled +Rebooting in 86400 seconds..
\ No newline at end of file diff --git a/pkg/report/testdata/linux/guilty/55 b/pkg/report/testdata/linux/guilty/55 new file mode 100644 index 000000000..bfbaad02f --- /dev/null +++ b/pkg/report/testdata/linux/guilty/55 @@ -0,0 +1,82 @@ +FILE: fs/ntfs/super.c + +loop4: detected capacity change from 0 to 264192 +================================== +WARNING: Nested lock was not taken +6.0.0-rc6-syzkaller-17742-gc194837ebb57 #0 Not tainted +---------------------------------- +syz-executor253/3315 is trying to lock: +ffff0000c495a9d8 (&s->s_inode_list_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] +ffff0000c495a9d8 (&s->s_inode_list_lock){+.+.}-{2:2}, at: inode_sb_list_del fs/inode.c:503 [inline] +ffff0000c495a9d8 (&s->s_inode_list_lock){+.+.}-{2:2}, at: evict+0x90/0x334 fs/inode.c:654 + +but this task is not holding: +Unable to handle kernel paging request at virtual address 0000000100000017 +Mem abort info: + ESR = 0x0000000096000005 + EC = 0x25: DABT (current EL), IL = 32 bits + SET = 0, FnV = 0 + EA = 0, S1PTW = 0 + FSC = 0x05: level 1 translation fault +Data abort info: + ISV = 0, ISS = 0x00000005 + CM = 0, WnR = 0 +user pgtable: 4k pages, 48-bit VAs, pgdp=000000010a8da000 +[0000000100000017] pgd=0800000107ed2003, p4d=0800000107ed2003, pud=0000000000000000 +Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP +Modules linked in: +CPU: 0 PID: 3315 Comm: syz-executor253 Not tainted 6.0.0-rc6-syzkaller-17742-gc194837ebb57 #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 +pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) +pc : print_lock_nested_lock_not_held kernel/locking/lockdep.c:4885 [inline] +pc : __lock_acquire+0x7cc/0x30a4 kernel/locking/lockdep.c:5044 +lr : print_lock_nested_lock_not_held kernel/locking/lockdep.c:4884 [inline] +lr : __lock_acquire+0x7c0/0x30a4 kernel/locking/lockdep.c:5044 +sp : ffff80001289b8b0 +x29: ffff80001289b990 x28: 0000000000000001 x27: ffff80000d30c000 +x26: ffff0000c68d24b8 x25: ffff0000c68d24d8 x24: 0000000000000002 +x23: ffff0000c68d24d0 x22: ffff80000d32a753 x21: ffff80000d32a712 +x20: 0000000000040067 x19: ffff0000c68d1a80 x18: 0000000000000156 +x17: 2b7463697665203a x16: 0000000000000002 x15: 0000000000000000 +x14: 0000000000000000 x13: 205d353133335420 x12: 5b5d303434313530 +x11: ff808000081c1630 x10: 0000000000000000 x9 : 30785d1575e13b00 +x8 : 00000000ffffffff x7 : 205b5d3034343135 x6 : ffff800008195d30 +x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 +x2 : 0000000000000000 x1 : 0000000100000001 x0 : ffff80000cb555a1 +Call trace: + print_lock_nested_lock_not_held kernel/locking/lockdep.c:4885 [inline] + __lock_acquire+0x7cc/0x30a4 kernel/locking/lockdep.c:5044 + lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666 + __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] + _raw_spin_lock+0x54/0x6c kernel/locking/spinlock.c:154 + spin_lock include/linux/spinlock.h:349 [inline] + inode_sb_list_del fs/inode.c:503 [inline] + evict+0x90/0x334 fs/inode.c:654 + iput_final fs/inode.c:1748 [inline] + iput+0x2c4/0x324 fs/inode.c:1774 + ntfs_fill_super+0x1254/0x14a4 fs/ntfs/super.c:188 + get_tree_bdev+0x1e8/0x2a0 fs/super.c:1323 + ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1358 + vfs_get_tree+0x40/0x140 fs/super.c:1530 + do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 + path_mount+0x358/0x914 fs/namespace.c:3370 + do_mount fs/namespace.c:3383 [inline] + __do_sys_mount fs/namespace.c:3591 [inline] + __se_sys_mount fs/namespace.c:3568 [inline] + __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3568 + __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] + invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] + el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 + do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 + el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 + el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 + el0t_64_sync+0x18c/0x190 +Code: 94f84769 f94002e8 d0024dc0 91168400 (f9400d01) +---[ end trace 0000000000000000 ]--- +---------------- +Code disassembly (best guess): + 0: 94f84769 bl 0x3e11da4 + 4: f94002e8 ldr x8, [x23] + 8: d0024dc0 adrp x0, 0x49ba000 + c: 91168400 add x0, x0, #0x5a1 +* 10: f9400d01 ldr x1, [x8, #24] <-- trapping instruction
\ No newline at end of file diff --git a/pkg/report/testdata/linux/guilty/56 b/pkg/report/testdata/linux/guilty/56 new file mode 100644 index 000000000..c03b8e958 --- /dev/null +++ b/pkg/report/testdata/linux/guilty/56 @@ -0,0 +1,61 @@ +FILE: net/tipc/topsrv.c + +general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN +KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] +CPU: 3 PID: 12841 Comm: kworker/u16:2 Not tainted 6.0.0-rc6-syzkaller-00210-gbf682942cd26 #0 +Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 +Workqueue: tipc_rcv tipc_topsrv_accept +RIP: 0010:kernel_accept+0x22d/0x350 net/socket.c:3487 +Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 e3 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5b 20 48 8d 7b 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 ee 00 00 00 48 8b 7b 08 e8 a0 36 1c fa e8 8b ff +RSP: 0018:ffffc9000494fc28 EFLAGS: 00010202 +RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000 +RDX: 0000000000000001 RSI: ffffffff874c37b2 RDI: 0000000000000008 +RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 +R10: 0000000000000000 R11: 0000000000000449 R12: 0000000000000000 +R13: ffff888027a7b980 R14: ffff888028bc08e0 R15: 1ffff92000929f90 +FS: 0000000000000000(0000) GS:ffff88802cb00000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 00007fa6e1a8c920 CR3: 000000004bba0000 CR4: 0000000000150ee0 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +Call Trace: + <TASK> + tipc_topsrv_accept+0x197/0x280 net/tipc/topsrv.c:460 + process_one_work+0x991/0x1610 kernel/workqueue.c:2289 + worker_thread+0x665/0x1080 kernel/workqueue.c:2436 + kthread+0x2e4/0x3a0 kernel/kthread.c:376 + ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 + </TASK> +Modules linked in: +---[ end trace 0000000000000000 ]--- +RIP: 0010:kernel_accept+0x22d/0x350 net/socket.c:3487 +Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 e3 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5b 20 48 8d 7b 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 ee 00 00 00 48 8b 7b 08 e8 a0 36 1c fa e8 8b ff +RSP: 0018:ffffc9000494fc28 EFLAGS: 00010202 +RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000 +RDX: 0000000000000001 RSI: ffffffff874c37b2 RDI: 0000000000000008 +RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 +R10: 0000000000000000 R11: 0000000000000449 R12: 0000000000000000 +R13: ffff888027a7b980 R14: ffff888028bc08e0 R15: 1ffff92000929f90 +FS: 0000000000000000(0000) GS:ffff88802ca00000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 000000c0154d8000 CR3: 000000006fb4b000 CR4: 0000000000150ee0 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +---------------- +Code disassembly (best guess): + 0: 48 89 fa mov %rdi,%rdx + 3: 48 c1 ea 03 shr $0x3,%rdx + 7: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) + b: 0f 85 e3 00 00 00 jne 0xf4 + 11: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax + 18: fc ff df + 1b: 48 8b 5b 20 mov 0x20(%rbx),%rbx + 1f: 48 8d 7b 08 lea 0x8(%rbx),%rdi + 23: 48 89 fa mov %rdi,%rdx + 26: 48 c1 ea 03 shr $0x3,%rdx +* 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction + 2e: 0f 85 ee 00 00 00 jne 0x122 + 34: 48 8b 7b 08 mov 0x8(%rbx),%rdi + 38: e8 a0 36 1c fa callq 0xfa1c36dd + 3d: e8 .byte 0xe8 + 3e: 8b ff mov %edi,%edi
\ No newline at end of file |
