bisecting fixing commit since 961f830af0658ef5ef8a7708786d634a6115f16b building syzkaller on 01975a06cb1a7b426ae17985374f2fff3ec38b62 testing commit 961f830af0658ef5ef8a7708786d634a6115f16b with gcc (GCC) 8.1.0 kernel signature: 3356e2a7835d51d0d019c4fdb1a704b38c0faae0a56aabd9a4a3d69edbad280a all runs: crashed: KASAN: use-after-free Read in hci_chan_del testing current HEAD 3207316b3beec7e38e5dbe2f463df0cec71e0b97 testing commit 3207316b3beec7e38e5dbe2f463df0cec71e0b97 with gcc (GCC) 8.1.0 kernel signature: 04c1c18b33b730278cd9e00eac47989aeaa29af1522d52c764cf8d7660d925f4 all runs: crashed: KASAN: use-after-free Read in hci_chan_del revisions tested: 2, total time: 32m40.861591077s (build: 20m37.035699919s, test: 11m21.746676217s) the crash still happens on HEAD commit msg: Linux 4.19.164 crash: KASAN: use-after-free Read in hci_chan_del Bluetooth: hci4: command 0x0406 tx timeout Bluetooth: hci2: command 0x0406 tx timeout Bluetooth: hci3: command 0x0406 tx timeout Bluetooth: hci5: command 0x0406 tx timeout ================================================================== BUG: KASAN: use-after-free in hci_chan_del+0x12b/0x170 net/bluetooth/hci_conn.c:1683 Read of size 8 at addr ffff8881db88a9d8 by task syz-executor.2/5945 CPU: 0 PID: 5945 Comm: syz-executor.2 Not tainted 4.19.164-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_load8_noabort+0x14/0x20 mm/kasan/report.c:433 hci_chan_del+0x12b/0x170 net/bluetooth/hci_conn.c:1683 l2cap_conn_del.isra.23+0x3dc/0x620 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:1261 [inline] hci_conn_hash_flush+0x10b/0x200 net/bluetooth/hci_conn.c:1512 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+0xa8e/0x2e00 kernel/exit.c:890 do_group_exit+0xf8/0x2c0 kernel/exit.c:993 get_signal+0x308/0x1970 kernel/signal.c:2589 do_signal+0x87/0x1860 arch/x86/kernel/signal.c:821 exit_to_usermode_loop+0x159/0x1e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x413/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45f97a Code: Bad RIP value. RSP: 002b:00007ffc90bb5948 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: 0000000000000000 RBX: 00007ffc90bb5970 RCX: 000000000045f97a RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003 RBP: 0000000000745ca0 R08: 00007ffc90bb596c R09: 0000000000004000 R10: 00007ffc90bb5970 R11: 0000000000000246 R12: 0000000000000003 R13: 0000000000000000 R14: 0000000000000029 R15: 0000000000743ae0 Allocated by task 21754: 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 kmem_cache_alloc_trace+0x152/0x3a0 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] sock_alloc_inode+0x5c/0x230 net/socket.c:247 alloc_inode+0x56/0x150 fs/inode.c:211 new_inode_pseudo+0xc/0xd0 fs/inode.c:911 sock_alloc+0x3c/0x270 net/socket.c:547 __sock_create+0x7a/0x540 net/socket.c:1240 sock_create net/socket.c:1316 [inline] __sys_socket+0xd7/0x1d0 net/socket.c:1346 __do_sys_socket net/socket.c:1355 [inline] __se_sys_socket net/socket.c:1353 [inline] __x64_sys_socket+0x6e/0xb0 net/socket.c:1353 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 0: 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] kfree+0xcf/0x220 mm/slab.c:3822 __rcu_reclaim kernel/rcu/rcu.h:231 [inline] rcu_do_batch kernel/rcu/tree.c:2584 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline] rcu_process_callbacks+0xa57/0x19b0 kernel/rcu/tree.c:2881 __do_softirq+0x25e/0x92d kernel/softirq.c:292 The buggy address belongs to the object at ffff8881db88a9c0 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8881db88a9c0, ffff8881db88aa40) The buggy address belongs to the page: page:ffffea00076e2280 count:1 mapcount:0 mapping:ffff8881f6400640 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea000774c1c8 ffffea0007d0f008 ffff8881f6400640 raw: 0000000000000000 ffff8881db88a000 0000000100000015 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881db88a880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881db88a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881db88a980: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881db88aa00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881db88aa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================