bisecting fixing commit since cbfa1702aaf69b2311ea1b35e04f113c48368c67 building syzkaller on 6bfdbe8950b22b1c832478bd397754f3108df040 testing commit cbfa1702aaf69b2311ea1b35e04f113c48368c67 with gcc (GCC) 8.1.0 kernel signature: ae3451cc16a426550198a7c56934c6f3977e066f176a029bbc07366a70919ce7 all runs: crashed: KASAN: use-after-free Read in hci_chan_del testing current HEAD 5b7a52cd2eef952cee8a72512ef370bcdef46636 testing commit 5b7a52cd2eef952cee8a72512ef370bcdef46636 with gcc (GCC) 8.1.0 kernel signature: 4742e8b00f8743b6f91fc4dc726b64edf63e26a99859071b8aab249a5a2377e8 all runs: crashed: KASAN: use-after-free Read in hci_chan_del revisions tested: 2, total time: 22m14.161882323s (build: 15m48.985141478s, test: 5m54.244900967s) the crash still happens on HEAD commit msg: Linux 4.14.202 crash: KASAN: use-after-free Read in hci_chan_del IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready ================================================================== BUG: KASAN: use-after-free in hci_chan_del+0x12b/0x170 net/bluetooth/hci_conn.c:1564 Read of size 8 at addr ffff8880a7e38c18 by task syz-executor.3/6506 CPU: 1 PID: 6506 Comm: syz-executor.3 Not tainted 4.14.202-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/0x1f1 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.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 hci_chan_del+0x12b/0x170 net/bluetooth/hci_conn.c:1564 l2cap_conn_del.isra.23+0x3cf/0x610 net/bluetooth/l2cap_core.c:1739 l2cap_disconn_cfm+0x61/0x80 net/bluetooth/l2cap_core.c:7441 hci_disconn_cfm include/net/bluetooth/hci_core.h:1226 [inline] hci_conn_hash_flush+0x10b/0x200 net/bluetooth/hci_conn.c:1393 hci_dev_do_close+0x47a/0xb10 net/bluetooth/hci_core.c:1620 hci_unregister_dev+0x163/0x790 net/bluetooth/hci_core.c:3191 vhci_release+0x6b/0xe0 drivers/bluetooth/hci_vhci.c:354 __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 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x953/0x2c40 kernel/exit.c:865 do_group_exit+0xf8/0x2c0 kernel/exit.c:962 SYSC_exit_group kernel/exit.c:973 [inline] SyS_exit_group+0x18/0x20 kernel/exit.c:971 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45e179 RSP: 002b:00007fffd550d488 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000016 RCX: 000000000045e179 RDX: 0000000000417841 RSI: 00000000016a9df0 RDI: 0000000000000000 RBP: 00000000004c2a6f R08: 000000000000000c R09: 0000000000000000 R10: 00000000020e2940 R11: 0000000000000246 R12: 00007fffd550e730 R13: 00000000020ebaa0 R14: 0000000000000000 R15: 00007fffd550f7c0 Allocated by task 6546: 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] hci_chan_create+0x7b/0x2e0 net/bluetooth/hci_conn.c:1549 l2cap_conn_add.part.16+0x15/0xbd0 net/bluetooth/l2cap_core.c:7062 l2cap_conn_add net/bluetooth/l2cap_core.c:97 [inline] l2cap_connect_cfm+0x319/0xd20 net/bluetooth/l2cap_core.c:7379 hci_connect_cfm include/net/bluetooth/hci_core.h:1211 [inline] hci_le_conn_complete_evt net/bluetooth/hci_event.c:4601 [inline] hci_le_meta_evt+0x31d2/0x42e0 net/bluetooth/hci_event.c:5169 hci_event_packet+0x141a/0x70c0 net/bluetooth/hci_event.c:5429 hci_rx_work+0x30e/0x8d0 net/bluetooth/hci_core.c:4244 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 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 6548: 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 hci_chan_del+0x11b/0x170 net/bluetooth/hci_conn.c:1579 amp_destroy_logical_link+0x9/0x10 net/bluetooth/amp.c:595 hci_disconn_loglink_complete_evt net/bluetooth/hci_event.c:4432 [inline] hci_event_packet+0x1b9f/0x70c0 net/bluetooth/hci_event.c:5450 hci_rx_work+0x30e/0x8d0 net/bluetooth/hci_core.c:4244 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 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 ffff8880a7e38c00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8880a7e38c00, ffff8880a7e38c80) The buggy address belongs to the page: page:ffffea00029f8e00 count:1 mapcount:0 mapping:ffff8880a7e38000 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff8880a7e38000 0000000000000000 0000000100000015 raw: ffffea00029b4160 ffffea0002ac7e60 ffff8880b6400640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a7e38b00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880a7e38b80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff8880a7e38c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a7e38c80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880a7e38d00: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ================================================================== wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 Bluetooth: hci3 command 0x0419 tx timeout Bluetooth: hci0 command 0x0419 tx timeout Bluetooth: hci4 command 0x0419 tx timeout Bluetooth: hci2 command 0x0419 tx timeout Bluetooth: hci5 command 0x0419 tx timeout