bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on 28ac5c9e93a44c3eb145195ffb55591be58ef510 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.4.1 20210217 kernel signature: 219e0fa701bbd69384ac6d098a0d006f9dc0bcd4b75d32a77bf0d3261c4e7cf8 run #0: crashed: BUG: corrupted list in l2cap_chan_put run #1: crashed: BUG: corrupted list in l2cap_chan_put run #2: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #3: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #4: crashed: BUG: corrupted list in l2cap_chan_put run #5: crashed: BUG: corrupted list in l2cap_chan_put run #6: crashed: KASAN: use-after-free Write in ex_handler_refcount run #7: crashed: BUG: corrupted list in l2cap_chan_put 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: BUG: corrupted list in l2cap_chan_put run #12: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #13: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #14: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown 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: BUG: corrupted list in l2cap_chan_put run #18: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #19: crashed: KASAN: use-after-free Write in ex_handler_refcount testing current HEAD 29c52025152bab4c557d8174da58f1a4c8e70438 testing commit 29c52025152bab4c557d8174da58f1a4c8e70438 with gcc (GCC) 8.4.1 20210217 kernel signature: 00eeddbf55e1f5a686b88852a37bd7a063d712ce40bf0c2a233d4f79b1a85709 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: KASAN: use-after-free Read in l2cap_sock_shutdown run #4: crashed: BUG: corrupted list in l2cap_chan_put run #5: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #6: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #7: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown run #8: crashed: BUG: corrupted list in l2cap_chan_put run #9: crashed: KASAN: use-after-free Read in l2cap_sock_shutdown revisions tested: 2, total time: 35m17.028108071s (build: 15m15.717996496s, test: 19m5.695787894s) the crash still happens on HEAD commit msg: Linux 4.14.221 crash: KASAN: use-after-free Read in l2cap_sock_shutdown Bluetooth: hci2 command 0x0419 tx timeout Bluetooth: hci3 command 0x0419 tx timeout Bluetooth: hci4 command 0x0419 tx timeout Bluetooth: hci5 command 0x0419 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 ffff8881e208b13e by task syz-executor293/12934 CPU: 1 PID: 12934 Comm: syz-executor293 Not tainted 4.14.221-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:00007fffd8a8ef90 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: 000000000006a002 R13: 00007fffd8a8f010 R14: 00007fffd8a8f000 R15: 00007fffd8a8efc0 Allocated by task 12934: 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 4632: 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:4066 [inline] hci_rx_work+0x5c9/0x8e0 net/bluetooth/hci_core.c:4249 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 ffff8881e208b100 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 62 bytes inside of 2048-byte region [ffff8881e208b100, ffff8881e208b900) The buggy address belongs to the page: page:ffffea0007882280 count:1 mapcount:0 mapping:ffff8881e208a000 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffff8881e208a000 0000000000000000 0000000100000003 raw: ffffea00079ef220 ffffea000765cd20 ffff8881f6000c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881e208b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e208b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881e208b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e208b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e208b200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================