bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on ff51e5229e0ee846d2fd687cb0dbca13de758c66 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.4.1 20210217 kernel signature: d17f8cf585c0d93a37f67033c87138e0de9f424b7a9e014bcfa3347052f4aa33 run #0: crashed: BUG: corrupted list 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: BUG: corrupted list in l2cap_chan_put run #6: crashed: BUG: corrupted list in l2cap_chan_put run #7: crashed: BUG: corrupted list in l2cap_chan_put run #8: crashed: BUG: corrupted list in l2cap_chan_put run #9: crashed: BUG: corrupted list in l2cap_chan_put run #10: crashed: BUG: corrupted list in l2cap_chan_put run #11: crashed: BUG: corrupted list in l2cap_chan_put run #12: crashed: BUG: corrupted list in l2cap_chan_put run #13: crashed: BUG: corrupted list in l2cap_chan_put 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: BUG: corrupted list in l2cap_chan_put run #17: crashed: BUG: corrupted list in l2cap_chan_put run #18: crashed: BUG: corrupted list in l2cap_chan_put run #19: crashed: BUG: corrupted list in l2cap_chan_put testing current HEAD cb83ddcd5332fcc3efd52ba994976efc4dd6061e testing commit cb83ddcd5332fcc3efd52ba994976efc4dd6061e with gcc (GCC) 8.4.1 20210217 kernel signature: 69bb7759e0e042e17147ca81482c17f8e9fedb04798edddc0b1bae05c294c183 run #0: crashed: BUG: corrupted list 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: BUG: corrupted list in l2cap_chan_put run #6: crashed: BUG: corrupted list in l2cap_chan_put run #7: crashed: BUG: corrupted list in l2cap_chan_put run #8: crashed: BUG: corrupted list in l2cap_chan_put run #9: crashed: KASAN: use-after-free Read in l2cap_chan_put revisions tested: 2, total time: 33m53.407158092s (build: 15m8.300197777s, test: 18m22.351485834s) the crash still happens on HEAD commit msg: Linux 4.14.226 crash: KASAN: use-after-free Read in l2cap_chan_put bond0 (unregistering): Releasing backup interface bond_slave_1 bond0 (unregistering): Releasing backup interface bond_slave_0 bond0 (unregistering): Released all slaves IPVS: ftp: loaded support on port[0] = 21 ================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xd0/0x100 lib/list_debug.c:42 Read of size 8 at addr ffff8881dbae7130 by task syz-executor312/927 CPU: 1 PID: 927 Comm: syz-executor312 Not tainted 4.14.226-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_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __list_del_entry_valid+0xd0/0x100 lib/list_debug.c:42 __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:0x406dcb RSP: 002b:00007ffe28ecaef0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000406dcb RDX: ffffffffffffffb8 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 00007ffe28ecaf50 R13: 00007ffe28ecaf40 R14: 00000000000659cc R15: 00007ffe28ecaf18 Allocated by task 927: 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 650: 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 ffff8881dbae6cc0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff8881dbae6cc0, ffff8881dbae74c0) The buggy address belongs to the page: page:ffffea00076eb980 count:1 mapcount:0 mapping:ffff8881dbae6440 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffff8881dbae6440 0000000000000000 0000000100000003 raw: ffffea00075fa820 ffff8881f6001948 ffff8881f6000c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881dbae7000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dbae7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881dbae7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881dbae7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dbae7200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== list_del corruption, ffff8881dbae7128->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: 927 Comm: syz-executor312 Tainted: G B 4.14.226-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8881c65184c0 task.stack: ffff8881e02a8000 RIP: 0010:__list_del_entry_valid.cold.1+0x26/0x4a lib/list_debug.c:45 RSP: 0018:ffff8881e02afcf8 EFLAGS: 00010282 RAX: 000000000000004e RBX: ffff8881dbae7128 RCX: 0000000000000000 RDX: 000000000000004e RSI: ffffffff86cbec60 RDI: ffffed103c055f96 RBP: ffff8881e02afd10 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff13446c7 R11: dffffc0000000000 R12: dead000000000200 R13: dead000000000100 R14: ffff8881dbae7148 R15: ffff8881dbae78a0 FS: 0000000000708300(0000) GS:ffff8881f6700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000180 CR3: 00000001f2bc0002 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:0x406dcb RSP: 002b:00007ffe28ecaef0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000406dcb RDX: ffffffffffffffb8 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 00007ffe28ecaf50 R13: 00007ffe28ecaf40 R14: 00000000000659cc R15: 00007ffe28ecaf18 Code: 86 f9 ff 0f 0b 4c 89 e2 48 89 de 48 c7 c7 a0 0e 04 87 e8 d4 86 f9 ff 0f 0b 4c 89 ea 48 89 de 48 c7 c7 40 0e 04 87 e8 c0 86 f9 ff <0f> 0b 48 89 de 48 c7 c7 60 0f 04 87 e8 af 86 f9 ff 0f 0b 48 89 RIP: __list_del_entry_valid.cold.1+0x26/0x4a lib/list_debug.c:45 RSP: ffff8881e02afcf8 ---[ end trace 1e8f58a10d21de5e ]---