bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on ff51e5229e0ee846d2fd687cb0dbca13de758c66 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.1.0 kernel signature: beac615075346443f8faecd98022d0d13e21b8f571a02b1234d71e10662d357a run #0: crashed: KASAN: use-after-free Write in hci_conn_del run #1: crashed: KASAN: use-after-free Write in hci_conn_del run #2: crashed: KASAN: use-after-free Write in hci_conn_del run #3: crashed: KASAN: use-after-free Write in hci_conn_del run #4: crashed: KASAN: use-after-free Write in hci_conn_del run #5: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #6: crashed: KASAN: use-after-free Write in hci_conn_del run #7: crashed: KASAN: use-after-free Write in hci_conn_del run #8: crashed: KASAN: use-after-free Write in hci_conn_del run #9: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del testing current HEAD 2f166cdcf8a92fcf85524f2b5526cb28e16f0a60 testing commit 2f166cdcf8a92fcf85524f2b5526cb28e16f0a60 with gcc (GCC) 8.1.0 kernel signature: 92244b13a8264db53ff22d9ab27a3e8f26f795d1eee303ffa621138cb31d184b run #0: crashed: KASAN: use-after-free Write in hci_conn_del run #1: crashed: KASAN: use-after-free Write in hci_conn_del run #2: crashed: KASAN: use-after-free Write in hci_conn_del run #3: crashed: KASAN: use-after-free Write in hci_conn_del run #4: crashed: KASAN: use-after-free Write in hci_conn_del run #5: crashed: KASAN: use-after-free Write in hci_conn_del run #6: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #7: crashed: KASAN: use-after-free Write in hci_conn_del run #8: crashed: KASAN: use-after-free Write in hci_conn_del run #9: crashed: KASAN: use-after-free Write in hci_conn_del revisions tested: 2, total time: 30m46.90120865s (build: 21m27.778106351s, test: 7m46.886892756s) the crash still happens on HEAD commit msg: Linux 4.14.196 crash: KASAN: use-after-free Write in hci_conn_del 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_del+0x587/0x5e0 net/bluetooth/hci_conn.c:596 Write of size 8 at addr ffff88809fc1ae88 by task syz-executor.0/6474 CPU: 0 PID: 6474 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_store8_noabort+0x17/0x20 mm/kasan/report.c:435 hci_conn_del+0x587/0x5e0 net/bluetooth/hci_conn.c:596 hci_conn_hash_flush+0x168/0x200 net/bluetooth/hci_conn.c:1377 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:0x45ce79 RSP: 002b:00007fffa3261f88 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045ce79 RDX: 00000000004168d1 RSI: 00000000016a85f0 RDI: 0000000000000043 RBP: 00000000004c2b1b R08: 000000000000000b R09: 0000000000000000 R10: 000000000323f940 R11: 0000000000000246 R12: 000000000000000f R13: 00007fffa32620d0 R14: 000000000001eccb R15: 00007fffa32620e0 Allocated by task 3651: 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 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x3e0 mm/slab.c:3552 getname_flags+0xb8/0x510 fs/namei.c:138 user_path_at_empty+0x1e/0x40 fs/namei.c:2631 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xb6/0x130 fs/stat.c:185 vfs_lstat include/linux/fs.h:3070 [inline] SYSC_newlstat fs/stat.c:350 [inline] SyS_newlstat+0x7d/0xc0 fs/stat.c:344 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 3651: 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] kmem_cache_free+0x80/0x2d0 mm/slab.c:3758 putname+0xa8/0xe0 fs/namei.c:259 filename_lookup.part.19+0x22c/0x340 fs/namei.c:2386 filename_lookup fs/namei.c:2370 [inline] user_path_at_empty+0x39/0x40 fs/namei.c:2631 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xb6/0x130 fs/stat.c:185 vfs_lstat include/linux/fs.h:3070 [inline] SYSC_newlstat fs/stat.c:350 [inline] SyS_newlstat+0x7d/0xc0 fs/stat.c:344 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff88809fc1a300 which belongs to the cache names_cache of size 4096 The buggy address is located 2952 bytes inside of 4096-byte region [ffff88809fc1a300, ffff88809fc1b300) The buggy address belongs to the page: page:ffffea00027f0680 count:1 mapcount:0 mapping:ffff88809fc1a300 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff88809fc1a300 0000000000000000 0000000100000001 raw: ffffea00027f1aa0 ffffea00027f8520 ffff8880aa9e1cc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809fc1ad80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809fc1ae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809fc1ae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809fc1af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809fc1af80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================