bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on ff51e5229e0ee846d2fd687cb0dbca13de758c66 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.1.0 kernel signature: 22d9fca4a4b8a3cc9c18b498527838f011db84afb2536325ae980735f9cd0855 run #0: crashed: KASAN: use-after-free Read in sco_chan_del run #1: crashed: KASAN: use-after-free Read in sco_chan_del run #2: crashed: KASAN: use-after-free Read in sco_chan_del run #3: crashed: KASAN: use-after-free Read in sco_chan_del run #4: crashed: KASAN: use-after-free Read in sco_chan_del run #5: crashed: KASAN: use-after-free Read in sco_chan_del run #6: crashed: KASAN: use-after-free Read in sco_chan_del run #7: crashed: KASAN: use-after-free Read in sco_chan_del run #8: crashed: KASAN: use-after-free Read in sco_chan_del run #9: crashed: KASAN: use-after-free in sco_chan_del testing current HEAD 2f166cdcf8a92fcf85524f2b5526cb28e16f0a60 testing commit 2f166cdcf8a92fcf85524f2b5526cb28e16f0a60 with gcc (GCC) 8.1.0 kernel signature: 67d39e0652149a942a3954868ac2de39f0e41b9a38c90458cda6afa0c9b88166 run #0: crashed: WARNING: ODEBUG bug in bt_link_release run #1: crashed: KASAN: use-after-free Read in sco_chan_del run #2: crashed: KASAN: use-after-free Read in sco_chan_del run #3: crashed: KASAN: use-after-free Read in sco_chan_del run #4: crashed: KASAN: use-after-free Read in sco_chan_del run #5: crashed: KASAN: use-after-free Read in sco_chan_del run #6: crashed: KASAN: use-after-free Read in sco_chan_del run #7: crashed: KASAN: use-after-free Read in sco_chan_del run #8: crashed: KASAN: use-after-free Read in sco_chan_del run #9: crashed: KASAN: use-after-free Read in sco_chan_del revisions tested: 2, total time: 28m58.003576595s (build: 21m17.043485922s, test: 6m14.534018841s) the crash still happens on HEAD commit msg: Linux 4.14.196 crash: KASAN: use-after-free Read in sco_chan_del IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in hci_conn_drop include/net/bluetooth/hci_core.h:963 [inline] BUG: KASAN: use-after-free in sco_chan_del+0x39f/0x3c0 net/bluetooth/sco.c:148 Read of size 1 at addr ffff88808b89ed35 by task syz-executor.0/8985 CPU: 0 PID: 8985 Comm: syz-executor.0 Not tainted 4.14.196-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_load1_noabort+0x14/0x20 mm/kasan/report.c:427 hci_conn_drop include/net/bluetooth/hci_core.h:963 [inline] sco_chan_del+0x39f/0x3c0 net/bluetooth/sco.c:148 __sco_sock_close+0x2d7/0x500 net/bluetooth/sco.c:433 sco_sock_close+0x26/0x40 net/bluetooth/sco.c:447 sco_sock_release+0x43/0x200 net/bluetooth/sco.c:1009 __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 get_signal+0x1460/0x1ab0 kernel/signal.c:2234 do_signal+0x7f/0x18b0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x11e/0x190 arch/x86/entry/common.c:160 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:0x45ce79 RSP: 002b:00007fe5a8c32c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffffc RBX: 0000000000002180 RCX: 000000000045ce79 RDX: 0000000000000008 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007ffcf6c283bf R14: 00007fe5a8c339c0 R15: 000000000118bf2c Allocated by task 8985: 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_conn_add+0x55/0x12c0 net/bluetooth/hci_conn.c:501 hci_connect_sco+0x1a3/0x670 net/bluetooth/hci_conn.c:1119 sco_connect net/bluetooth/sco.c:240 [inline] sco_sock_connect+0x244/0x810 net/bluetooth/sco.c:576 SYSC_connect net/socket.c:1655 [inline] SyS_connect+0x199/0x2b0 net/socket.c:1636 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 1201: 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 bt_link_release+0x10/0x20 net/bluetooth/hci_sysfs.c:14 device_release+0xd7/0x170 drivers/base/core.c:831 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x10d/0x1b0 lib/kobject.c:692 put_device+0x12/0x20 drivers/base/core.c:2014 hci_conn_put include/net/bluetooth/hci_core.h:945 [inline] hci_conn_cleanup+0x2cc/0x520 net/bluetooth/hci_conn.c:134 hci_conn_del+0x211/0x5e0 net/bluetooth/hci_conn.c:611 hci_phy_link_complete_evt net/bluetooth/hci_event.c:4362 [inline] hci_event_packet+0x581e/0x70be net/bluetooth/hci_event.c:5436 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 ffff88808b89ed00 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 53 bytes inside of 4096-byte region [ffff88808b89ed00, ffff88808b89fd00) The buggy address belongs to the page: page:ffffea00022e2780 count:1 mapcount:0 mapping:ffff88808b89ed00 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff88808b89ed00 0000000000000000 0000000100000001 raw: ffffea00027fe720 ffffea000281b520 ffff8880aa800dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808b89ec00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808b89ec80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808b89ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808b89ed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808b89ee00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================