bisecting fixing commit since c076c79e03c6094e578df5d210fde808b3ad32e6 building syzkaller on 4ca1c0ea446d2c09b1fb49a85ae645e3754f1058 testing commit c076c79e03c6094e578df5d210fde808b3ad32e6 with gcc (GCC) 8.1.0 kernel signature: 10fce9770bebc64f99ac8e129dc868f4a088bd4569abcd66d6304f51c8439215 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 Read in __queue_work run #8: crashed: KASAN: use-after-free Write in hci_conn_del run #9: crashed: KASAN: use-after-free Write in hci_conn_del testing current HEAD f5d8eef067acee3fda37137f4a08c0d3f6427a8e testing commit f5d8eef067acee3fda37137f4a08c0d3f6427a8e with gcc (GCC) 8.1.0 kernel signature: 1f7ea2b33fc13ad5c41e8f8f86fac45c47efc46501ce6f9752860afb0e1ecab2 all runs: crashed: KASAN: use-after-free Write in hci_conn_del revisions tested: 2, total time: 27m30.355411467s (build: 17m29.684921976s, test: 9m20.48743237s) the crash still happens on HEAD commit msg: Linux 4.19.154 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 ffff8880a4b7f3f0 by task syz-executor.5/6660 CPU: 1 PID: 6660 Comm: syz-executor.5 Not tainted 4.19.154-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:1513 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: ff 64 48 8b 0c 25 f8 ff ff ff 48 3b 61 10 76 21 48 83 ec 18 48 89 6c 24 10 48 8d 6c 24 10 c6 04 24 01 e8 3a a4 fd ff 48 8b 6c <24> 10 48 83 c4 18 c3 e8 eb 31 00 00 eb c9 cc cc cc cc cc cc cc cc RSP: 002b:00007fff7630e698 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045ccd9 RDX: 0000000000416731 RSI: 0000000000ca85f0 RDI: 0000000000000043 RBP: 00000000004c2963 R08: 000000000000000b R09: 0000000000000000 R10: 0000000000cb5940 R11: 0000000000000246 R12: 0000000000000019 R13: 00007fff7630e7e0 R14: 0000000000021422 R15: 00007fff7630e7f0 Allocated by task 3714: 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 user_path_at_empty+0x1e/0x40 fs/namei.c:2609 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xbe/0x150 fs/stat.c:185 vfs_lstat include/linux/fs.h:3138 [inline] __do_sys_newlstat fs/stat.c:350 [inline] __se_sys_newlstat+0x85/0xe0 fs/stat.c:344 __x64_sys_newlstat+0x4f/0x70 fs/stat.c:344 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 3714: 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 filename_lookup.part.21+0x1ec/0x360 fs/namei.c:2358 filename_lookup fs/namei.c:2342 [inline] user_path_at_empty+0x39/0x40 fs/namei.c:2609 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xbe/0x150 fs/stat.c:185 vfs_lstat include/linux/fs.h:3138 [inline] __do_sys_newlstat fs/stat.c:350 [inline] __se_sys_newlstat+0x85/0xe0 fs/stat.c:344 __x64_sys_newlstat+0x4f/0x70 fs/stat.c:344 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 ffff8880a4b7ea00 which belongs to the cache names_cache of size 4096 The buggy address is located 2544 bytes inside of 4096-byte region [ffff8880a4b7ea00, ffff8880a4b7fa00) The buggy address belongs to the page: page:ffffea000292df80 count:1 mapcount:0 mapping:ffff88823b847080 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea00028b1c88 ffffea0002459008 ffff88823b847080 raw: 0000000000000000 ffff8880a4b7ea00 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a4b7f280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a4b7f300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a4b7f380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a4b7f400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a4b7f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================