bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on f721e4a097714a9054b9fe1aadf427afbbd2c157 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.1.0 kernel signature: 2706c8e867b3850c5161e8580d7c4be9cc109de4a94bf4fb4d552ece233af9aa run #0: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #1: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #2: crashed: BUG: corrupted list in bt_accept_unlink run #3: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK reproducer seems to be flaky testing current HEAD c196b3a9c83ae3491280b739d231d02b3cb9d041 testing commit c196b3a9c83ae3491280b739d231d02b3cb9d041 with gcc (GCC) 8.1.0 kernel signature: 08e2621ee29782f7d25ddeabbcb345629bc32991060a2d13d89c8bade73464c7 run #0: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #1: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #2: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #3: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #4: crashed: KASAN: use-after-free Read in bt_accept_enqueue run #5: crashed: KASAN: use-after-free Read in bt_accept_dequeue run #6: crashed: KASAN: use-after-free Read in bt_accept_unlink run #7: OK run #8: OK run #9: OK Reproducer flagged being flaky revisions tested: 2, total time: 41m51.384450625s (build: 22m31.24180354s, test: 18m45.152138389s) the crash still happens on HEAD commit msg: Linux 4.14.210 crash: KASAN: use-after-free Read in bt_accept_unlink Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) ================================================================== Bluetooth: Wrong link type (-22) BUG: KASAN: use-after-free in __list_del_entry_valid+0xf1/0xf3 lib/list_debug.c:51 Read of size 8 at addr ffff8881d6d8fb10 by task kworker/u5:1/7144 CPU: 1 PID: 7144 Comm: kworker/u5:1 Not tainted 4.14.210-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: hci4 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 Bluetooth: Wrong link type (-22) kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __list_del_entry_valid+0xf1/0xf3 lib/list_debug.c:51 __list_del_entry include/linux/list.h:117 [inline] list_del_init include/linux/list.h:159 [inline] bt_accept_unlink+0x1f/0x1f0 net/bluetooth/af_bluetooth.c:187 l2cap_sock_teardown_cb+0x163/0x3e0 net/bluetooth/l2cap_sock.c:1363 l2cap_chan_del+0x9b/0x790 net/bluetooth/l2cap_core.c:599 l2cap_disconnect_req net/bluetooth/l2cap_core.c:4353 [inline] l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5432 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5798 [inline] l2cap_recv_frame+0x4403/0x9e10 net/bluetooth/l2cap_core.c:7023 Bluetooth: Wrong link type (-22) Bluetooth: Wrong link type (-22) l2cap_recv_acldata+0x756/0x8a0 net/bluetooth/l2cap_core.c:7594 hci_acldata_packet net/bluetooth/hci_core.c:4066 [inline] hci_rx_work+0x5d4/0x8d0 net/bluetooth/hci_core.c:4249 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 Bluetooth: Wrong link type (-22) worker_thread+0xcc/0xed0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 Bluetooth: Wrong link type (-22) ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 7975: 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 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15d/0x410 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] sk_prot_alloc+0x196/0x240 net/core/sock.c:1467 sk_alloc+0x34/0xc20 net/core/sock.c:1521 l2cap_sock_alloc.constprop.4+0x28/0x1e0 net/bluetooth/l2cap_sock.c:1618 l2cap_sock_new_connection_cb+0xd8/0x180 net/bluetooth/l2cap_sock.c:1257 l2cap_connect+0x35a/0x1280 net/bluetooth/l2cap_core.c:3869 l2cap_connect_req net/bluetooth/l2cap_core.c:3980 [inline] l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5415 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5798 [inline] l2cap_recv_frame+0x1cd0/0x9e10 net/bluetooth/l2cap_core.c:7023 l2cap_recv_acldata+0x756/0x8a0 net/bluetooth/l2cap_core.c:7594 hci_acldata_packet net/bluetooth/hci_core.c:4066 [inline] hci_rx_work+0x5d4/0x8d0 net/bluetooth/hci_core.c:4249 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 Bluetooth: Wrong link type (-22) worker_thread+0xcc/0xed0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Freed by task 7975: 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 Bluetooth: Wrong link type (-22) sk_prot_free net/core/sock.c:1504 [inline] __sk_destruct+0x47e/0x5a0 net/core/sock.c:1582 sk_destruct+0x83/0xb0 net/core/sock.c:1597 __sk_free+0x47/0x1f0 net/core/sock.c:1605 sk_free+0x1a/0x20 net/core/sock.c:1616 sock_put include/net/sock.h:1662 [inline] l2cap_sock_kill.part.2+0x52/0x60 net/bluetooth/l2cap_sock.c:1056 l2cap_sock_kill net/bluetooth/l2cap_sock.c:1325 [inline] l2cap_sock_close_cb+0x84/0xa0 net/bluetooth/l2cap_sock.c:1324 l2cap_disconnect_req net/bluetooth/l2cap_core.c:4355 [inline] l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5432 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5798 [inline] l2cap_recv_frame+0x443f/0x9e10 net/bluetooth/l2cap_core.c:7023 l2cap_recv_acldata+0x756/0x8a0 net/bluetooth/l2cap_core.c:7594 hci_acldata_packet net/bluetooth/hci_core.c:4066 [inline] hci_rx_work+0x5d4/0x8d0 net/bluetooth/hci_core.c:4249 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 Bluetooth: Wrong link type (-22) worker_thread+0xcc/0xed0 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 ffff8881d6d8f6c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1104 bytes inside of 2048-byte region [ffff8881d6d8f6c0, ffff8881d6d8fec0) The buggy address belongs to the page: page:ffffea00075b6380 count:1 mapcount:0 mapping:ffff8881d6d8e5c0 index:0x0 compound_mapcount: 0 Bluetooth: Wrong link type (-22) flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffff8881d6d8e5c0 0000000000000000 0000000100000003 raw: ffffea000770ef20 ffffea000762c7a0 ffff8881f6000c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d6d8fa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Bluetooth: Wrong link type (-22) ffff8881d6d8fa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d6d8fb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d6d8fb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d6d8fc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================