bisecting fixing commit since c076c79e03c6094e578df5d210fde808b3ad32e6 building syzkaller on 4ca1c0ea446d2c09b1fb49a85ae645e3754f1058 testing commit c076c79e03c6094e578df5d210fde808b3ad32e6 with gcc (GCC) 8.1.0 kernel signature: ecd3a0c450ee8c2b11b8c48cbc776df2d8d3b8d5ec14ad71de78f68d31975b91 all runs: crashed: KASAN: use-after-free Write in hci_conn_del testing current HEAD c37da90efff5f183bea6ae4c2af33571f61fe317 testing commit c37da90efff5f183bea6ae4c2af33571f61fe317 with gcc (GCC) 8.1.0 kernel signature: 11f5cf7a184115dc334318b55153ef126c74a4805a07552fbc127418c8ae39a5 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: use-after-free Write in hci_conn_del run #7: crashed: KASAN: use-after-free Write in hci_conn_del run #8: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #9: crashed: KASAN: use-after-free Write in hci_conn_del revisions tested: 2, total time: 35m27.171177974s (build: 20m47.224604877s, test: 13m6.987241029s) the crash still happens on HEAD commit msg: Linux 4.19.143 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+0x5a4/0x5f0 net/bluetooth/hci_conn.c:596 Write of size 8 at addr ffff88808a1f0a70 by task syz-executor.3/6600 CPU: 0 PID: 6600 Comm: syz-executor.3 Not tainted 4.19.143-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x22a lib/dump_stack.c:118 print_address_description.cold.6+0x9/0x211 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x307 mm/kasan/report.c:412 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:438 hci_conn_del+0x5a4/0x5f0 net/bluetooth/hci_conn.c:596 hci_conn_hash_flush+0x168/0x200 net/bluetooth/hci_conn.c:1496 hci_dev_do_close+0x4d2/0xcd0 net/bluetooth/hci_core.c:1666 hci_unregister_dev+0x163/0x7a0 net/bluetooth/hci_core.c:3271 vhci_release+0x6b/0xe0 drivers/bluetooth/hci_vhci.c:354 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa6a/0x2db0 kernel/exit.c:887 do_group_exit+0xf8/0x2c0 kernel/exit.c:990 __do_sys_exit_group kernel/exit.c:1001 [inline] __se_sys_exit_group kernel/exit.c:999 [inline] __x64_sys_exit_group+0x39/0x40 kernel/exit.c:999 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45ccd9 Code: 2d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffc21d10a08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045ccd9 RDX: 0000000000416731 RSI: 0000000000ca85f0 RDI: 0000000000000043 RBP: 00000000004c2963 R08: 000000000000000b R09: 0000000000000000 R10: 000000000250e940 R11: 0000000000000246 R12: 0000000000000019 R13: 00007ffc21d10b50 R14: 000000000002cd37 R15: 00007ffc21d10b60 Allocated by task 3709: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:553 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:538 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x390 mm/slab.c:3559 getname_flags+0xb8/0x510 fs/namei.c:140 getname+0xd/0x10 fs/namei.c:211 do_sys_open+0x14c/0x350 fs/open.c:1079 __do_sys_open fs/open.c:1103 [inline] __se_sys_open fs/open.c:1098 [inline] __x64_sys_open+0x79/0xb0 fs/open.c:1098 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 3709: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x13c/0x220 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x83/0x290 mm/slab.c:3765 putname+0xa8/0xe0 fs/namei.c:261 do_sys_open+0x16e/0x350 fs/open.c:1094 __do_sys_open fs/open.c:1103 [inline] __se_sys_open fs/open.c:1098 [inline] __x64_sys_open+0x79/0xb0 fs/open.c:1098 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808a1f0880 which belongs to the cache names_cache of size 4096 The buggy address is located 496 bytes inside of 4096-byte region [ffff88808a1f0880, ffff88808a1f1880) The buggy address belongs to the page: page:ffffea0002287c00 count:1 mapcount:0 mapping:ffff88821bc47800 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea0002306588 ffffea0002302f08 ffff88821bc47800 raw: 0000000000000000 ffff88808a1f0880 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808a1f0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808a1f0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808a1f0a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808a1f0a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808a1f0b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================