aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/testdata
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-01-08 12:46:51 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-01-08 12:46:51 +0100
commit93b4c6f135aeecbb756fe8c8a3d46c7a05412a54 (patch)
tree78c605bfec8068ad9cc0fb81d27c2df8ebecf6a0 /pkg/report/testdata
parent19c05fffcb1860b2dcf17989b40ca16ed259fdea (diff)
pkg/report: add few more test cases where we fail
Diffstat (limited to 'pkg/report/testdata')
-rw-r--r--pkg/report/testdata/linux/guilty/2897
-rw-r--r--pkg/report/testdata/linux/report/149111
-rw-r--r--pkg/report/testdata/linux/report/15089
3 files changed, 297 insertions, 0 deletions
diff --git a/pkg/report/testdata/linux/guilty/28 b/pkg/report/testdata/linux/guilty/28
new file mode 100644
index 000000000..fbdf20a4f
--- /dev/null
+++ b/pkg/report/testdata/linux/guilty/28
@@ -0,0 +1,97 @@
+# TODO: this must be net/strparser/strparser.c
+FILE: kernel/workqueue.c
+
+==================================================================
+BUG: KASAN: use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:325 [inline]
+BUG: KASAN: use-after-free in work_is_static_object+0x39/0x40 kernel/workqueue.c:443
+Read of size 8 at addr ffff8801beca5788 by task syz-executor2/12922
+
+CPU: 0 PID: 12922 Comm: syz-executor2 Not tainted 4.15.0-rc5+ #178
+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
+ print_address_description+0x73/0x250 mm/kasan/report.c:252
+ kasan_report_error mm/kasan/report.c:351 [inline]
+ kasan_report+0x25b/0x340 mm/kasan/report.c:409
+ __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
+ constant_test_bit arch/x86/include/asm/bitops.h:325 [inline]
+ work_is_static_object+0x39/0x40 kernel/workqueue.c:443
+ debug_object_activate+0x36f/0x730 lib/debugobjects.c:470
+ debug_work_activate kernel/workqueue.c:492 [inline]
+ __queue_work+0x163/0x1230 kernel/workqueue.c:1381
+ queue_work_on+0x16a/0x1c0 kernel/workqueue.c:1487
+ queue_work include/linux/workqueue.h:488 [inline]
+ strp_check_rcv+0x25/0x30 net/strparser/strparser.c:552
+ kcm_attach net/kcm/kcmsock.c:1439 [inline]
+ kcm_attach_ioctl net/kcm/kcmsock.c:1460 [inline]
+ kcm_ioctl+0x82f/0x1690 net/kcm/kcmsock.c:1665
+ sock_do_ioctl+0x65/0xb0 net/socket.c:956
+ sock_ioctl+0x2c2/0x440 net/socket.c:1053
+ vfs_ioctl fs/ioctl.c:46 [inline]
+ do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
+ SYSC_ioctl fs/ioctl.c:701 [inline]
+ SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
+ entry_SYSCALL_64_fastpath+0x23/0x9a
+RIP: 0033:0x452ac9
+RSP: 002b:00007f1bbd860c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000010
+RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9
+RDX: 0000000020954ff8 RSI: 00000000000089e0 RDI: 0000000000000017
+RBP: 000000000000057b R08: 0000000000000000 R09: 0000000000000000
+R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f6428
+R13: 00000000ffffffff R14: 00007f1bbd8616d4 R15: 0000000000000000
+
+Allocated by task 12922:
+ save_stack+0x43/0xd0 mm/kasan/kasan.c:447
+ set_track mm/kasan/kasan.c:459 [inline]
+ kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
+ kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489
+ kmem_cache_alloc+0x12e/0x760 mm/slab.c:3544
+ kmem_cache_zalloc include/linux/slab.h:678 [inline]
+ kcm_attach net/kcm/kcmsock.c:1394 [inline]
+ kcm_attach_ioctl net/kcm/kcmsock.c:1460 [inline]
+ kcm_ioctl+0x2d2/0x1690 net/kcm/kcmsock.c:1665
+ sock_do_ioctl+0x65/0xb0 net/socket.c:956
+ sock_ioctl+0x2c2/0x440 net/socket.c:1053
+ vfs_ioctl fs/ioctl.c:46 [inline]
+ do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
+ SYSC_ioctl fs/ioctl.c:701 [inline]
+ SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
+ entry_SYSCALL_64_fastpath+0x23/0x9a
+
+Freed by task 12929:
+ save_stack+0x43/0xd0 mm/kasan/kasan.c:447
+ set_track mm/kasan/kasan.c:459 [inline]
+ kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
+ __cache_free mm/slab.c:3488 [inline]
+ kmem_cache_free+0x83/0x2a0 mm/slab.c:3746
+ kcm_unattach+0xe53/0x1510 net/kcm/kcmsock.c:1563
+ kcm_unattach_ioctl net/kcm/kcmsock.c:1608 [inline]
+ kcm_ioctl+0xe54/0x1690 net/kcm/kcmsock.c:1675
+ sock_do_ioctl+0x65/0xb0 net/socket.c:956
+ sock_ioctl+0x2c2/0x440 net/socket.c:1053
+ vfs_ioctl fs/ioctl.c:46 [inline]
+ do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
+ SYSC_ioctl fs/ioctl.c:701 [inline]
+ SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
+ entry_SYSCALL_64_fastpath+0x23/0x9a
+
+The buggy address belongs to the object at ffff8801beca56c0
+ which belongs to the cache kcm_psock_cache of size 544
+The buggy address is located 200 bytes inside of
+ 544-byte region [ffff8801beca56c0, ffff8801beca58e0)
+The buggy address belongs to the page:
+page:000000005180a80a count:1 mapcount:0 mapping:0000000058aa9a5c index:0x0 compound_mapcount: 0
+flags: 0x2fffc0000008100(slab|head)
+raw: 02fffc0000008100 ffff8801beca40c0 0000000000000000 000000010000000b
+raw: ffff8801d31e8a48 ffff8801d31e8a48 ffff8801d3f6a380 0000000000000000
+page dumped because: kasan: bad access detected
+
+Memory state around the buggy address:
+ ffff8801beca5680: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
+ ffff8801beca5700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+ffff8801beca5780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+ ^
+ ffff8801beca5800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+ ffff8801beca5880: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
+==================================================================
diff --git a/pkg/report/testdata/linux/report/149 b/pkg/report/testdata/linux/report/149
new file mode 100644
index 000000000..219f1737c
--- /dev/null
+++ b/pkg/report/testdata/linux/report/149
@@ -0,0 +1,111 @@
+# TODO: Ideally, this should be something like
+# "KASAN: use-after-free Read in work_is_static_object in strp_check_rcv"
+# because work_is_static_object is a generic function and different bugs
+# can manifest this way.
+TITLE: KASAN: use-after-free Read in work_is_static_object
+
+[ 1140.689311] ==================================================================
+[ 1140.696784] BUG: KASAN: use-after-free in work_is_static_object+0x39/0x40
+[ 1140.703711] Read of size 8 at addr ffff8801beca5788 by task syz-executor2/12922
+[ 1140.711147]
+[ 1140.712770] CPU: 0 PID: 12922 Comm: syz-executor2 Not tainted 4.15.0-rc5+ #178
+[ 1140.720123] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
+[ 1140.729462] Call Trace:
+[ 1140.732034] dump_stack+0x194/0x257
+[ 1140.735659] ? arch_local_irq_restore+0x53/0x53
+[ 1140.740300] ? show_regs_print_info+0x18/0x18
+[ 1140.744769] ? lock_release+0xa40/0xa40
+[ 1140.748714] ? debug_check_no_locks_freed+0x3c0/0x3c0
+[ 1140.753877] ? work_is_static_object+0x39/0x40
+[ 1140.758436] print_address_description+0x73/0x250
+[ 1140.763254] ? work_is_static_object+0x39/0x40
+[ 1140.767810] kasan_report+0x25b/0x340
+[ 1140.771589] __asan_report_load8_noabort+0x14/0x20
+[ 1140.776492] work_is_static_object+0x39/0x40
+[ 1140.780875] debug_object_activate+0x36f/0x730
+[ 1140.785434] ? debug_object_assert_init+0x570/0x570
+[ 1140.790424] ? trace_hardirqs_on+0xd/0x10
+[ 1140.794550] ? __debug_object_init+0x235/0x1040
+[ 1140.799193] ? save_stack+0x43/0xd0
+[ 1140.802802] __queue_work+0x163/0x1230
+[ 1140.806661] ? __queue_work+0x163/0x1230
+[ 1140.810704] ? retint_kernel+0x10/0x10
+[ 1140.814578] ? insert_work+0x5f0/0x5f0
+[ 1140.818702] ? retint_kernel+0x10/0x10
+[ 1140.823880] ? find_held_lock+0x35/0x1d0
+[ 1140.829619] ? kcm_ioctl+0x823/0x1690
+[ 1140.833394] ? lock_downgrade+0x980/0x980
+[ 1140.837514] ? kcm_rcv_strparser+0x9a0/0x9a0
+[ 1140.841894] ? lock_release+0xa40/0xa40
+[ 1140.845842] ? strp_check_rcv+0x30/0x30
+[ 1140.849789] ? __local_bh_enable_ip+0x121/0x230
+[ 1140.854435] queue_work_on+0x16a/0x1c0
+[ 1140.858299] strp_check_rcv+0x25/0x30
+[ 1140.862071] kcm_ioctl+0x82f/0x1690
+[ 1140.865676] ? kcm_unattach+0x1510/0x1510
+[ 1140.869796] ? avc_ss_reset+0x110/0x110
+[ 1140.873740] ? lock_downgrade+0x980/0x980
+[ 1140.877863] ? lock_release+0xa40/0xa40
+[ 1140.881811] ? __lock_is_held+0xb6/0x140
+[ 1140.885871] sock_do_ioctl+0x65/0xb0
+[ 1140.889563] sock_ioctl+0x2c2/0x440
+[ 1140.893163] ? dlci_ioctl_set+0x40/0x40
+[ 1140.897110] do_vfs_ioctl+0x1b1/0x1520
+[ 1140.900970] ? _cond_resched+0x14/0x30
+[ 1140.904848] ? ioctl_preallocate+0x2b0/0x2b0
+[ 1140.909231] ? selinux_capable+0x40/0x40
+[ 1140.913278] ? SyS_futex+0x269/0x390
+[ 1140.916980] ? security_file_ioctl+0x89/0xb0
+[ 1140.921364] SyS_ioctl+0x8f/0xc0
+[ 1140.924708] entry_SYSCALL_64_fastpath+0x23/0x9a
+[ 1140.929431] RIP: 0033:0x452ac9
+[ 1140.932591] RSP: 002b:00007f1bbd860c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000010
+[ 1140.940270] RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9
+[ 1140.947516] RDX: 0000000020954ff8 RSI: 00000000000089e0 RDI: 0000000000000017
+[ 1140.954760] RBP: 000000000000057b R08: 0000000000000000 R09: 0000000000000000
+[ 1140.962002] R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f6428
+[ 1140.969251] R13: 00000000ffffffff R14: 00007f1bbd8616d4 R15: 0000000000000000
+[ 1140.976508]
+[ 1140.978108] Allocated by task 12922:
+[ 1140.981797] save_stack+0x43/0xd0
+[ 1140.985220] kasan_kmalloc+0xad/0xe0
+[ 1140.988907] kasan_slab_alloc+0x12/0x20
+[ 1140.992851] kmem_cache_alloc+0x12e/0x760
+[ 1140.996968] kcm_ioctl+0x2d2/0x1690
+[ 1141.000566] sock_do_ioctl+0x65/0xb0
+[ 1141.004248] sock_ioctl+0x2c2/0x440
+[ 1141.007846] do_vfs_ioctl+0x1b1/0x1520
+[ 1141.011707] SyS_ioctl+0x8f/0xc0
+[ 1141.015054] entry_SYSCALL_64_fastpath+0x23/0x9a
+[ 1141.019779]
+[ 1141.021376] Freed by task 12929:
+[ 1141.024714] save_stack+0x43/0xd0
+[ 1141.028135] kasan_slab_free+0x71/0xc0
+[ 1141.031991] kmem_cache_free+0x83/0x2a0
+[ 1141.035941] kcm_unattach+0xe53/0x1510
+[ 1141.039797] kcm_ioctl+0xe54/0x1690
+[ 1141.043393] sock_do_ioctl+0x65/0xb0
+[ 1141.047078] sock_ioctl+0x2c2/0x440
+[ 1141.050673] do_vfs_ioctl+0x1b1/0x1520
+[ 1141.054529] SyS_ioctl+0x8f/0xc0
+[ 1141.057866] entry_SYSCALL_64_fastpath+0x23/0x9a
+[ 1141.062586]
+[ 1141.064186] The buggy address belongs to the object at ffff8801beca56c0
+[ 1141.064186] which belongs to the cache kcm_psock_cache of size 544
+[ 1141.077163] The buggy address is located 200 bytes inside of
+[ 1141.077163] 544-byte region [ffff8801beca56c0, ffff8801beca58e0)
+[ 1141.089015] The buggy address belongs to the page:
+[ 1141.093923] page:000000005180a80a count:1 mapcount:0 mapping:0000000058aa9a5c index:0x0 compound_mapcount: 0
+[ 1141.103862] flags: 0x2fffc0000008100(slab|head)
+[ 1141.108503] raw: 02fffc0000008100 ffff8801beca40c0 0000000000000000 000000010000000b
+[ 1141.116357] raw: ffff8801d31e8a48 ffff8801d31e8a48 ffff8801d3f6a380 0000000000000000
+[ 1141.124206] page dumped because: kasan: bad access detected
+[ 1141.129888]
+[ 1141.131492] Memory state around the buggy address:
+[ 1141.136397] ffff8801beca5680: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
+[ 1141.143734] ffff8801beca5700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+[ 1141.151076] >ffff8801beca5780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+[ 1141.158418] ^
+[ 1141.162028] ffff8801beca5800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
+[ 1141.169364] ffff8801beca5880: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
+[ 1141.176691] ==================================================================
diff --git a/pkg/report/testdata/linux/report/150 b/pkg/report/testdata/linux/report/150
new file mode 100644
index 000000000..ab9966b84
--- /dev/null
+++ b/pkg/report/testdata/linux/report/150
@@ -0,0 +1,89 @@
+# TODO: This should be "WARNING: held lock freed! in __sk_destruct"
+TITLE: WARNING: held lock freed!
+
+[ 25.058100] =========================
+[ 25.061864] WARNING: held lock freed!
+[ 25.065632] 4.15.0-rc6+ #250 Not tainted
+[ 25.069655] -------------------------
+[ 25.073423] syzkaller065230/3505 is freeing memory 000000007fcba654-00000000499fef26, with a lock still held there!
+[ 25.083959] (sk_lock-AF_INET6){+.+.}, at: [<00000000abe26b8e>] sctp_wait_for_sndbuf+0x509/0x8d0
+[ 25.092871] 1 lock held by syzkaller065230/3505:
+[ 25.097592] #0: (sk_lock-AF_INET6){+.+.}, at: [<00000000abe26b8e>] sctp_wait_for_sndbuf+0x509/0x8d0
+[ 25.106926]
+[ 25.106926] stack backtrace:
+[ 25.111388] CPU: 0 PID: 3505 Comm: syzkaller065230 Not tainted 4.15.0-rc6+ #250
+[ 25.118800] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
+[ 25.128122] Call Trace:
+[ 25.130685] dump_stack+0x194/0x257
+[ 25.134284] ? arch_local_irq_restore+0x53/0x53
+[ 25.138929] debug_check_no_locks_freed+0x32f/0x3c0
+[ 25.143918] kmem_cache_free+0x68/0x2a0
+[ 25.147864] __sk_destruct+0x622/0x910
+[ 25.151718] ? kasan_slab_free+0x71/0xc0
+[ 25.155748] ? sock_rfree+0x160/0x160
+[ 25.159515] ? inet_sendmsg+0x11f/0x5e0
+[ 25.163455] ? SYSC_sendto+0x361/0x5c0
+[ 25.167307] ? SyS_sendto+0x40/0x50
+[ 25.170902] ? entry_SYSCALL_64_fastpath+0x23/0x9a
+[ 25.175818] ? check_noncircular+0x20/0x20
+[ 25.180019] ? print_irqtrace_events+0x270/0x270
+[ 25.184756] ? free_obj_work+0x690/0x690
+[ 25.188787] ? sctp_put_port+0x495/0x640
+[ 25.192826] ? sctp_poll+0xc00/0xc00
+[ 25.196510] ? refcount_sub_and_test+0x115/0x1b0
+[ 25.201233] ? refcount_inc+0x50/0x50
+[ 25.204999] ? refcount_inc+0x50/0x50
+[ 25.208770] sk_destruct+0x47/0x80
+[ 25.212275] __sk_free+0x57/0x230
+[ 25.215698] sk_free+0x2a/0x40
+[ 25.218857] sctp_association_put+0x14c/0x2f0
+[ 25.223318] ? sctp_association_hold+0x20/0x20
+[ 25.227865] ? lock_sock_nested+0x91/0x110
+[ 25.232068] ? trace_hardirqs_on+0xd/0x10
+[ 25.236186] ? __local_bh_enable_ip+0x121/0x230
+[ 25.240833] sctp_wait_for_sndbuf+0x673/0x8d0
+[ 25.245307] ? sctp_init_sock+0x13b0/0x13b0
+[ 25.249597] ? do_raw_spin_trylock+0x190/0x190
+[ 25.254155] ? __local_bh_enable_ip+0x121/0x230
+[ 25.258789] ? sctp_prsctp_prune+0x97/0x6f0
+[ 25.263080] ? prepare_to_wait+0x4d0/0x4d0
+[ 25.267976] ? trace_hardirqs_on+0xd/0x10
+[ 25.272095] sctp_sendmsg+0x277d/0x3360
+[ 25.276050] ? put_pi_state+0x3c0/0x560
+[ 25.280001] ? sctp_id2assoc+0x390/0x390
+[ 25.284031] ? avc_has_perm+0x43e/0x680
+[ 25.287975] ? avc_has_perm_noaudit+0x520/0x520
+[ 25.292621] ? __fget+0x35c/0x570
+[ 25.296047] ? iterate_fd+0x3f0/0x3f0
+[ 25.299819] ? find_held_lock+0x35/0x1d0
+[ 25.303862] ? sock_has_perm+0x2a4/0x420
+[ 25.307889] ? lock_release+0x962/0xa40
+[ 25.311829] ? trace_event_raw_event_sched_switch+0x800/0x800
+[ 25.317689] ? __check_object_size+0x25d/0x4f0
+[ 25.322261] inet_sendmsg+0x11f/0x5e0
+[ 25.326027] ? inet_sendmsg+0x11f/0x5e0
+[ 25.329968] ? __might_sleep+0x95/0x190
+[ 25.333909] ? inet_recvmsg+0x5f0/0x5f0
+[ 25.337854] ? selinux_socket_sendmsg+0x36/0x40
+[ 25.342500] ? security_socket_sendmsg+0x89/0xb0
+[ 25.347220] ? inet_recvmsg+0x5f0/0x5f0
+[ 25.351161] sock_sendmsg+0xca/0x110
+[ 25.354841] SYSC_sendto+0x361/0x5c0
+[ 25.358521] ? SYSC_connect+0x4a0/0x4a0
+[ 25.362461] ? selinux_secmark_relabel_packet+0xc0/0xc0
+[ 25.367791] ? __do_page_fault+0x3d6/0xc90
+[ 25.371995] ? selinux_netlbl_sock_rcv_skb+0x730/0x730
+[ 25.377250] ? SyS_futex+0x269/0x390
+[ 25.380930] ? SyS_setsockopt+0x215/0x360
+[ 25.385059] ? do_futex+0x22a0/0x22a0
+[ 25.388827] ? entry_SYSCALL_64_fastpath+0x5/0x9a
+[ 25.393648] SyS_sendto+0x40/0x50
+[ 25.397077] entry_SYSCALL_64_fastpath+0x23/0x9a
+[ 25.401808] RIP: 0033:0x445db9
+[ 25.404964] RSP: 002b:00007f2467415d98 EFLAGS: 00000212 ORIG_RAX: 000000000000002c
+[ 25.412638] RAX: ffffffffffffffda RBX: 00000000006dbc84 RCX: 0000000000445db9
+[ 25.419874] RDX: 0000000000000001 RSI: 000000002010bf14 RDI: 0000000000000005
+[ 25.428507] RBP: 0000000000000000 R08: 00000000204d9000 R09: 000000000000001c
+[ 25.435744] R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006dbc80
+[ 25.443327] R13: 00000000209a9000 R14: 0100000000000000 R15: 0000000000000001
+[ 25.450699] ==================================================================