bisecting fixing commit since cbfa1702aaf69b2311ea1b35e04f113c48368c67 building syzkaller on 6bfdbe8950b22b1c832478bd397754f3108df040 testing commit cbfa1702aaf69b2311ea1b35e04f113c48368c67 with gcc (GCC) 8.1.0 kernel signature: f13e01cfbc2febd220b7424d3b461d00092db34672afdcc0a8907773252b09f1 all runs: crashed: KASAN: use-after-free Read in hci_chan_del testing current HEAD 1752938529c614a8ed4432ecce6ebc95d3b87207 testing commit 1752938529c614a8ed4432ecce6ebc95d3b87207 with gcc (GCC) 8.1.0 kernel signature: 026f477632b678cf924ede245b50992edcd8ab3558ef4589f2a12c2d3d229585 all runs: crashed: KASAN: use-after-free Read in hci_chan_del revisions tested: 2, total time: 22m7.120418388s (build: 16m16.907301722s, test: 5m20.072383971s) the crash still happens on HEAD commit msg: Linux 4.14.213 crash: KASAN: use-after-free Read in hci_chan_del IPv6: ADDRCONF(NETDEV_UP): veth0_macvtap: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): macsec0: link becomes ready ================================================================== IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready BUG: KASAN: use-after-free in hci_chan_del+0x12b/0x170 net/bluetooth/hci_conn.c:1564 IPv6: ADDRCONF(NETDEV_UP): veth1_macvtap: link is not ready Read of size 8 at addr ffff8881e9a4ecd8 by task syz-executor.1/5841 IPv6: ADDRCONF(NETDEV_CHANGE): veth1_macvtap: link becomes ready CPU: 0 PID: 5841 Comm: syz-executor.1 Not tainted 4.14.213-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 IPv6: ADDRCONF(NETDEV_CHANGE): veth0_macvtap: link becomes ready 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 IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready vhci_release+0x6b/0xe0 drivers/bluetooth/hci_vhci.c:354 device veth0_macvtap entered promiscuous mode __fput+0x232/0x740 fs/file_table.c:210 IPv6: ADDRCONF(NETDEV_UP): macvtap0: link is not ready ____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+0x98b/0x2c90 kernel/exit.c:868 do_group_exit+0xf8/0x2c0 kernel/exit.c:965 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 SYSC_exit_group kernel/exit.c:976 [inline] SyS_exit_group+0x18/0x20 kernel/exit.c:974 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45e179 RSP: 002b:00007fff0cbb52d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000016 RCX: 000000000045e179 RDX: 0000000000417841 RSI: 00000000016a9df0 RDI: 0000000000000000 RBP: 00000000004c2a6f R08: 000000000000000c R09: 0000000000000000 R10: 00000000028cd940 R11: 0000000000000246 R12: 00007fff0cbb6580 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! R13: 00000000028d6aa0 R14: 0000000000000000 R15: 00007fff0cbb7610 Allocated by task 5871: 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 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 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:4606 [inline] hci_le_meta_evt+0x322a/0x4330 net/bluetooth/hci_event.c:5172 hci_event_packet+0x1486/0x70c2 net/bluetooth/hci_event.c:5432 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 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! Freed by task 5877: 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:4437 [inline] hci_event_packet+0x1aa4/0x70c2 net/bluetooth/hci_event.c:5453 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 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! The buggy address belongs to the object at ffff8881e9a4ecc0 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881e9a4ecc0, ffff8881e9a4ed40) The buggy address belongs to the page: page:ffffea0007a69380 count:1 mapcount:0 mapping:ffff8881e9a4e000 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881e9a4e000 0000000000000000 0000000100000015 raw: ffffea0007b2a620 ffffea0007a167e0 ffff8881f6000640 0000000000000000 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 page dumped because: kasan: bad access detected batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! Memory state around the buggy address: ffff8881e9a4eb80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready ffff8881e9a4ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb batman_adv: batadv0: Interface activated: batadv_slave_0 >ffff8881e9a4ec80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb device veth1_macvtap entered promiscuous mode ^ IPv6: ADDRCONF(NETDEV_UP): macsec0: link is not ready ffff8881e9a4ed00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881e9a4ed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ieee80211 phy3: mac80211_hwsim_configure_filter IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready