aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/testdata/linux
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-10-02 13:35:55 +0200
committerDmitry Vyukov <dvyukov@google.com>2022-10-04 10:53:17 +0200
commit2b1c88827ab90892e2437a0054b16587defe089e (patch)
tree1802b8791021de454ca70feb99a61d1c064c1220 /pkg/report/testdata/linux
parentcf4bf0b8b145eb256d10861a5f1ed3e4c6a37c2f (diff)
pkg/report: improve parsing of "nested lock was not taken"
Parse the stack trace for the WARNING since the guilty frame is not necessary the first one. Skip iput/ihold functions. They are called dozens of times throughout the kernel and the bug is more likely to be in the caller.
Diffstat (limited to 'pkg/report/testdata/linux')
-rw-r--r--pkg/report/testdata/linux/report/65751
-rw-r--r--pkg/report/testdata/linux/report/65887
2 files changed, 138 insertions, 0 deletions
diff --git a/pkg/report/testdata/linux/report/657 b/pkg/report/testdata/linux/report/657
new file mode 100644
index 000000000..9f1e1443b
--- /dev/null
+++ b/pkg/report/testdata/linux/report/657
@@ -0,0 +1,51 @@
+TITLE: WARNING: nested lock was not taken in ntfs_fill_super
+
+[ 292.991605][T13544] ==================================
+[ 292.996890][T13544] WARNING: Nested lock was not taken
+[ 293.002171][T13544] 6.0.0-rc7-syzkaller-00220-gffb4d94b4314 #0 Not tainted
+[ 293.009187][T13544] ----------------------------------
+[ 293.014464][T13544] syz-executor.3/13544 is trying to lock:
+[ 293.020176][T13544] ffff88803c86db70 (&sb->s_type->i_lock_key#36){+.+.}-{2:2}, at: _atomic_dec_and_lock+0x9d/0x110
+[ 293.030778][T13544]
+[ 293.030778][T13544] but this task is not holding:
+[ 293.037813][T13544] general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN
+[ 293.049528][T13544] KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
+[ 293.057940][T13544] CPU: 0 PID: 13544 Comm: syz-executor.3 Not tainted 6.0.0-rc7-syzkaller-00220-gffb4d94b4314 #0
+[ 293.068349][T13544] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
+[ 293.078407][T13544] RIP: 0010:__lock_acquire+0x1112/0x1f60
+[ 293.084128][T13544] Code: 3c 30 00 48 8b 5c 24 70 74 12 48 89 df e8 66 b5 72 00 49 be 00 00 00 00 00 fc ff df 48 8b 1b 48 83 c3 18 48 89 d8 48 c1 e8 03 <42> 80 3c 30 00 74 08 48 89 df e8 3f b5 72 00 48 8b 33 45 31 f6 48
+[ 293.103745][T13544] RSP: 0000:ffffc90004cd7828 EFLAGS: 00010006
+[ 293.109815][T13544] RAX: 0000000000000003 RBX: 0000000000000018 RCX: b2d9940eb6955500
+[ 293.117792][T13544] RDX: 0000000000000000 RSI: 0000000080000001 RDI: 0000000000000000
+[ 293.125763][T13544] RBP: ffff88802da005e0 R08: ffffffff816bd38d R09: ffffed1017344f14
+[ 293.133734][T13544] R10: ffffed1017344f14 R11: 1ffff11017344f13 R12: ffff88802da00848
+[ 293.141706][T13544] R13: 4fa3c035f2826504 R14: dffffc0000000000 R15: ffff88802da00000
+[ 293.149674][T13544] FS: 00007fa645647700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
+[ 293.158608][T13544] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+[ 293.165190][T13544] CR2: 00007f32fc112dc9 CR3: 000000001db81000 CR4: 00000000003506f0
+[ 293.173163][T13544] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+[ 293.181141][T13544] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+[ 293.189119][T13544] Call Trace:
+[ 293.192408][T13544] <TASK>
+[ 293.195352][T13544] lock_acquire+0x182/0x3c0
+[ 293.220069][T13544] _raw_spin_lock+0x2a/0x40
+[ 293.229862][T13544] _atomic_dec_and_lock+0x9d/0x110
+[ 293.234979][T13544] iput+0x85/0x760
+[ 293.238707][T13544] ntfs_fill_super+0x3af3/0x42a0
+[ 293.252783][T13544] get_tree_bdev+0x400/0x620
+[ 293.261711][T13544] vfs_get_tree+0x88/0x270
+[ 293.266135][T13544] do_new_mount+0x289/0xad0
+[ 293.280957][T13544] __se_sys_mount+0x2d3/0x3c0
+[ 293.306387][T13544] do_syscall_64+0x3d/0xb0
+[ 293.310808][T13544] entry_SYSCALL_64_after_hwframe+0x63/0xcd
+[ 293.316706][T13544] RIP: 0033:0x7fa64448bada
+[ 293.321133][T13544] Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 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 b8 ff ff ff f7 d8 64 89 01 48
+[ 293.340742][T13544] RSP: 002b:00007fa645646f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
+[ 293.349162][T13544] RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007fa64448bada
+[ 293.357147][T13544] RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fa645646fe0
+[ 293.365129][T13544] RBP: 00007fa645647020 R08: 00007fa645647020 R09: 0000000020000000
+[ 293.373103][T13544] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000
+[ 293.381081][T13544] R13: 0000000020000100 R14: 00007fa645646fe0 R15: 0000000020000140
+[ 293.389064][T13544] </TASK>
+[ 293.392083][T13544] Modules linked in:
+[ 293.395984][T13544] ---[ end trace 0000000000000000 ]---
diff --git a/pkg/report/testdata/linux/report/658 b/pkg/report/testdata/linux/report/658
new file mode 100644
index 000000000..59c0a8d3d
--- /dev/null
+++ b/pkg/report/testdata/linux/report/658
@@ -0,0 +1,87 @@
+TITLE: KASAN: stack-out-of-bounds Read in ntfs_fill_super
+ALT: bad-access in ntfs_fill_super
+
+[ 474.455813][T13922] ==================================================================
+[ 474.463900][T13922] BUG: KASAN: stack-out-of-bounds in lock_acquire+0x1c3/0x3c0
+[ 474.471408][T13922] Read of size 8 at addr ffffc9000b7df95f by task syz-executor383/13922
+[ 474.479735][T13922]
+[ 474.482063][T13922] CPU: 0 PID: 13922 Comm: syz-executor383 Not tainted 6.0.0-rc6-syzkaller #0
+[ 474.490825][T13922] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
+[ 474.500881][T13922] Call Trace:
+[ 474.504164][T13922] <TASK>
+[ 474.507102][T13922] dump_stack_lvl+0x1b1/0x28e
+[ 474.529494][T13922] print_address_description+0x65/0x4b0
+[ 474.535058][T13922] print_report+0x108/0x1f0
+[ 474.544223][T13922] kasan_report+0xc3/0xf0
+[ 474.553209][T13922] lock_acquire+0x1c3/0x3c0
+[ 474.568548][T13922] _raw_spin_lock+0x2a/0x40
+[ 474.577058][T13922] iput+0x3ee/0x760
+[ 474.580855][T13922] ntfs_fill_super+0x2352/0x42a0
+[ 474.594918][T13922] get_tree_bdev+0x400/0x620
+[ 474.603838][T13922] vfs_get_tree+0x88/0x270
+[ 474.608238][T13922] do_new_mount+0x289/0xad0
+[ 474.623185][T13922] __se_sys_mount+0x2d3/0x3c0
+[ 474.648533][T13922] do_syscall_64+0x3d/0xb0
+[ 474.652940][T13922] entry_SYSCALL_64_after_hwframe+0x63/0xcd
+[ 474.658818][T13922] RIP: 0033:0x7f203d446d7a
+[ 474.663217][T13922] Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 d8 00 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 b8 ff ff ff f7 d8 64 89 01 48
+[ 474.682809][T13922] RSP: 002b:00007f203d3f1078 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
+[ 474.691206][T13922] RAX: ffffffffffffffda RBX: 00007f203d3f10d0 RCX: 00007f203d446d7a
+[ 474.699160][T13922] RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f203d3f1090
+[ 474.707119][T13922] RBP: 000000000000000e R08: 00007f203d3f10d0 R09: 00007f203d3f16b8
+[ 474.715074][T13922] R10: 0000000000000000 R11: 0000000000000286 R12: 00007f203d3f1090
+[ 474.723030][T13922] R13: 0000000020000350 R14: 0000000000000003 R15: 0000000000000004
+[ 474.730992][T13922] </TASK>
+[ 474.733996][T13922]
+[ 474.736303][T13922] The buggy address belongs to stack of task syz-executor383/13922
+[ 474.744171][T13922] and is located at offset 31 in frame:
+[ 474.749780][T13922] lock_acquire+0x0/0x3c0
+[ 474.754095][T13922]
+[ 474.756403][T13922] This frame has 3 objects:
+[ 474.760883][T13922] [32, 40) 'flags.i.i.i87'
+[ 474.760893][T13922] [64, 72) 'flags.i.i.i'
+[ 474.765373][T13922] [96, 136) 'hlock'
+[ 474.769680][T13922]
+[ 474.775859][T13922] The buggy address belongs to the virtual mapping at
+[ 474.775859][T13922] [ffffc9000b7d8000, ffffc9000b7e1000) created by:
+[ 474.775859][T13922] dup_task_struct+0x8b/0x490
+[ 474.793609][T13922]
+[ 474.795918][T13922] The buggy address belongs to the physical page:
+[ 474.802309][T13922] page:ffffea0001bcb8c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6f2e3
+[ 474.812440][T13922] flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
+[ 474.819538][T13922] raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
+[ 474.828102][T13922] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
+[ 474.836665][T13922] page dumped because: kasan: bad access detected
+[ 474.843054][T13922] page_owner tracks the page as allocated
+[ 474.848748][T13922] page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 3629, tgid 3629 (syz-executor383), ts 473162860658, free_ts 11190855215
+[ 474.868264][T13922] get_page_from_freelist+0x742/0x7c0
+[ 474.873644][T13922] __alloc_pages+0x259/0x560
+[ 474.878218][T13922] __vmalloc_node_range+0x8f4/0x1290
+[ 474.883531][T13922] alloc_thread_stack_node+0x307/0x500
+[ 474.888973][T13922] dup_task_struct+0x8b/0x490
+[ 474.893633][T13922] copy_process+0x65b/0x3fd0
+[ 474.898213][T13922] kernel_clone+0x21f/0x790
+[ 474.902711][T13922] __x64_sys_clone+0x228/0x290
+[ 474.907463][T13922] do_syscall_64+0x3d/0xb0
+[ 474.911874][T13922] entry_SYSCALL_64_after_hwframe+0x63/0xcd
+[ 474.917761][T13922] page last free stack trace:
+[ 474.922423][T13922] free_pcp_prepare+0x812/0x900
+[ 474.927258][T13922] free_unref_page+0x7d/0x5f0
+[ 474.931914][T13922] free_contig_range+0xa3/0x160
+[ 474.936746][T13922] destroy_args+0xfe/0x91d
+[ 474.941216][T13922] debug_vm_pgtable+0x43e/0x497
+[ 474.946063][T13922] do_one_initcall+0x1b9/0x3e0
+[ 474.950820][T13922] do_initcall_level+0x168/0x218
+[ 474.955795][T13922] do_initcalls+0x4b/0x8c
+[ 474.960118][T13922] kernel_init_freeable+0x3f1/0x57b
+[ 474.965302][T13922] kernel_init+0x19/0x2b0
+[ 474.969627][T13922] ret_from_fork+0x1f/0x30
+[ 474.974045][T13922]
+[ 474.976367][T13922] Memory state around the buggy address:
+[ 474.981995][T13922] ffffc9000b7df800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+[ 474.990049][T13922] ffffc9000b7df880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+[ 474.998098][T13922] >ffffc9000b7df900: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2
+[ 475.006143][T13922] ^
+[ 475.013059][T13922] ffffc9000b7df980: 00 f2 f2 f2 00 00 00 00 00 f3 f3 f3 f3 f3 f3 f3
+[ 475.021114][T13922] ffffc9000b7dfa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+[ 475.029169][T13922] ==================================================================