bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on 28ac5c9e93a44c3eb145195ffb55591be58ef510 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.4.1 20210217 kernel signature: ebf114c88f5c3d074d6b1fd2e6fab3228853d719d5b75eecf45ed1576b229df3 run #0: crashed: KASAN: use-after-free Read in l2cap_chan_put run #1: crashed: BUG: corrupted list in l2cap_chan_put run #2: crashed: BUG: corrupted list in l2cap_chan_put run #3: crashed: BUG: corrupted list in l2cap_chan_put run #4: crashed: BUG: corrupted list in l2cap_chan_put run #5: crashed: KASAN: use-after-free Read in l2cap_chan_put run #6: crashed: BUG: corrupted list in l2cap_chan_put run #7: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #8: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #9: crashed: BUG: corrupted list in l2cap_chan_put run #10: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #11: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #12: crashed: BUG: corrupted list in l2cap_chan_put run #13: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #14: crashed: BUG: corrupted list in l2cap_chan_put run #15: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #16: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #17: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #18: crashed: BUG: corrupted list in l2cap_chan_put run #19: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown testing current HEAD 7d7d1c0ab3eb7c8d8f63a126535018007823b207 testing commit 7d7d1c0ab3eb7c8d8f63a126535018007823b207 with gcc (GCC) 8.4.1 20210217 kernel signature: f19df1a8d07381241b7157ba280c3743ba3d9bbd72c261a6e210f57b55a41ab5 run #0: crashed: BUG: corrupted list in l2cap_chan_put run #1: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #2: crashed: BUG: corrupted list in l2cap_chan_put run #3: crashed: BUG: corrupted list in l2cap_chan_put run #4: crashed: WARNING: held lock freed in l2cap_sock_release run #5: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #6: crashed: BUG: corrupted list in l2cap_chan_put run #7: crashed: BUG: corrupted list in l2cap_chan_put run #8: boot failed: can't ssh into the instance run #9: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown revisions tested: 2, total time: 39m44.841733058s (build: 15m53.895944477s, test: 23m22.914645035s) the crash still happens on HEAD commit msg: Linux 4.14.232 crash: KASAN: use-after-free Read in l2cap_sock_shutdown Bluetooth: hci3 command 0x0409 tx timeout Bluetooth: hci0 command 0x041b tx timeout Bluetooth: hci4 command 0x0409 tx timeout Bluetooth: hci1 command 0x041b tx timeout ================================================================== BUG: KASAN: use-after-free in l2cap_sock_shutdown+0x954/0xbb0 net/bluetooth/l2cap_sock.c:1132 Read of size 1 at addr ffff8881f47f53fe by task syz-executor911/5842 CPU: 1 PID: 5842 Comm: syz-executor911 Not tainted 4.14.232-syzkaller #0 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+0x14b/0x1e7 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold.7+0x11a/0x2d3 mm/kasan/report.c:393 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:427 l2cap_sock_shutdown+0x954/0xbb0 net/bluetooth/l2cap_sock.c:1132 l2cap_sock_release+0x60/0x230 net/bluetooth/l2cap_sock.c:1203 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x14a/0x190 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x406fcb RSP: 002b:00007ffdaf29fe90 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000406fcb RDX: ffffffffffffffb8 RSI: 00000000400443c8 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0404040400000015 R10: 0000000000000000 R11: 0000000000000293 R12: 00000000000ab4bc R13: 00007ffdaf29ff10 R14: 00007ffdaf29ff00 R15: 00007ffdaf29fec0 Allocated by task 5842: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 kmem_cache_alloc_trace+0x152/0x3f0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] l2cap_chan_create+0x41/0x380 net/bluetooth/l2cap_core.c:444 l2cap_sock_alloc.constprop.4+0x150/0x1e0 net/bluetooth/l2cap_sock.c:1633 l2cap_sock_create+0xb5/0x180 net/bluetooth/l2cap_sock.c:1664 bt_sock_create+0x121/0x260 net/bluetooth/af_bluetooth.c:130 __sock_create+0x262/0x540 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xd5/0x1e0 net/socket.c:1325 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 7242: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 l2cap_chan_destroy net/bluetooth/l2cap_core.c:482 [inline] kref_put include/linux/kref.h:70 [inline] l2cap_chan_put+0x141/0x1a0 net/bluetooth/l2cap_core.c:496 l2cap_conless_channel net/bluetooth/l2cap_core.c:6982 [inline] l2cap_recv_frame+0xeca/0x9e10 net/bluetooth/l2cap_core.c:7029 l2cap_recv_acldata+0x756/0x8a0 net/bluetooth/l2cap_core.c:7594 hci_acldata_packet net/bluetooth/hci_core.c:4068 [inline] hci_rx_work+0x5c9/0x8e0 net/bluetooth/hci_core.c:4251 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xee0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 The buggy address belongs to the object at ffff8881f47f53c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 62 bytes inside of 2048-byte region [ffff8881f47f53c0, ffff8881f47f5bc0) The buggy address belongs to the page: page:ffffea0007d1fd00 count:1 mapcount:0 mapping:ffff8881f47f42c0 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffff8881f47f42c0 0000000000000000 0000000100000003 raw: ffffea000779d220 ffffea00074f45a0 ffff8881f6000c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881f47f5280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881f47f5300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881f47f5380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881f47f5400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881f47f5480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Bluetooth: hci2 command 0x041b tx timeout Bluetooth: hci5 command 0x0409 tx timeout list_del corruption, ffff8881f47f5828->next is LIST_POISON1 (dead000000000100) ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:47! invalid opcode: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 5842 Comm: syz-executor911 Tainted: G B 4.14.232-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8881ec8b4480 task.stack: ffff8881e24c8000 RIP: 0010:__list_del_entry_valid.cold.1+0x26/0x4a lib/list_debug.c:45 RSP: 0018:ffff8881e24cfcf8 EFLAGS: 00010282 RAX: 000000000000004e RBX: ffff8881f47f5828 RCX: 0000000000000000 RDX: 000000000000004e RSI: ffffffff86cbeca0 RDI: ffffed103c499f96 RBP: ffff8881e24cfd10 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff1344ec7 R11: dffffc0000000000 R12: dead000000000200 R13: dead000000000100 R14: ffff8881f47f5848 R15: ffff8881d52fc560 FS: 0000000000936300(0000) GS:ffff8881f6700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000004d14a0 CR3: 00000001d9fca002 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __list_del_entry include/linux/list.h:117 [inline] list_del include/linux/list.h:125 [inline] l2cap_chan_destroy net/bluetooth/l2cap_core.c:479 [inline] kref_put include/linux/kref.h:70 [inline] l2cap_chan_put+0x49/0x1a0 net/bluetooth/l2cap_core.c:496 l2cap_sock_release+0x1b4/0x230 net/bluetooth/l2cap_sock.c:1213 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x14a/0x190 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x406fcb RSP: 002b:00007ffdaf29fe90 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000406fcb RDX: ffffffffffffffb8 RSI: 00000000400443c8 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0404040400000015 R10: 0000000000000000 R11: 0000000000000293 R12: 00000000000ab4bc R13: 00007ffdaf29ff10 R14: 00007ffdaf29ff00 R15: 00007ffdaf29fec0 Code: 83 f9 ff 0f 0b 4c 89 e2 48 89 de 48 c7 c7 20 22 04 87 e8 f7 82 f9 ff 0f 0b 4c 89 ea 48 89 de 48 c7 c7 c0 21 04 87 e8 e3 82 f9 ff <0f> 0b 48 89 de 48 c7 c7 e0 22 04 87 e8 d2 82 f9 ff 0f 0b 48 89 RIP: __list_del_entry_valid.cold.1+0x26/0x4a lib/list_debug.c:45 RSP: ffff8881e24cfcf8 ---[ end trace 890ee3b5353da3ff ]---