bisecting fixing commit since 13af6c74b14a883366e7702c40c52ff548096e7f building syzkaller on 96dd36234d97bbf6b403f3a7f03cfc0296422879 testing commit 13af6c74b14a883366e7702c40c52ff548096e7f with gcc (GCC) 8.1.0 kernel signature: b6e99c657d937c51aaeb1f62bcee5118ccb6ae6ba81bb4ad78a2286a44c79942 run #0: crashed: KASAN: use-after-free Read in skb_dequeue run #1: crashed: KASAN: use-after-free Read in skb_dequeue run #2: crashed: KASAN: use-after-free Read in hci_dev_reset run #3: crashed: KASAN: use-after-free Read in hci_dev_reset run #4: crashed: KASAN: use-after-free Read in skb_dequeue run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK testing current HEAD b09c34517e1ac4018e3bb75ed5c8610a8a1f486b testing commit b09c34517e1ac4018e3bb75ed5c8610a8a1f486b with gcc (GCC) 8.1.0 kernel signature: bf6977e04bb5c9e6b8ff7592c266c8057e74669c26e576f0c69d3ac7ae3853cf run #0: crashed: KASAN: use-after-free Read in skb_dequeue run #1: crashed: KASAN: use-after-free Read in skb_dequeue run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK revisions tested: 2, total time: 37m30.248483061s (build: 17m38.835720477s, test: 19m5.078570321s) the crash still happens on HEAD commit msg: Linux 4.19.149 crash: KASAN: use-after-free Read in skb_dequeue 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 Bluetooth: hci3: command 0x0419 tx timeout ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x31e1/0x47c0 kernel/locking/lockdep.c:3294 Read of size 8 at addr ffff88808edba300 by task syz-executor.2/13720 CPU: 1 PID: 13720 Comm: syz-executor.2 Not tainted 4.19.149-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 __lock_acquire+0x31e1/0x47c0 kernel/locking/lockdep.c:3294 lock_acquire+0x180/0x3a0 kernel/locking/lockdep.c:3907 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:152 skb_dequeue+0x20/0x1f0 net/core/skbuff.c:2819 skb_queue_purge+0x1a/0x30 net/core/skbuff.c:2857 vhci_flush+0x36/0x50 drivers/bluetooth/hci_vhci.c:292 hci_dev_do_reset net/bluetooth/hci_core.c:1772 [inline] hci_dev_reset+0x16d/0x300 net/bluetooth/hci_core.c:1807 hci_sock_ioctl+0x258/0x600 net/bluetooth/hci_sock.c:1028 sock_do_ioctl+0xd9/0x230 net/socket.c:950 sock_ioctl+0x281/0x500 net/socket.c:1074 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x196/0x10c0 fs/ioctl.c:688 ksys_ioctl+0x62/0x90 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6e/0xb0 fs/ioctl.c:710 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45cc79 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:00007f50072edc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000001d300 RCX: 000000000045cc79 RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000004 RBP: 000000000078bfe0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bfac R13: 00007fff8fbda85f R14: 00007f50072ee9c0 R15: 000000000078bfac Allocated by task 6594: 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] kzalloc include/linux/slab.h:709 [inline] vhci_open+0x4b/0x300 drivers/bluetooth/hci_vhci.c:326 misc_open+0x31b/0x4d0 drivers/char/misc.c:141 chrdev_open+0x1ed/0x5c0 fs/char_dev.c:423 do_dentry_open+0x3f1/0x1010 fs/open.c:796 vfs_open+0x9a/0xc0 fs/open.c:902 do_last fs/namei.c:3421 [inline] path_openat+0x905/0x2870 fs/namei.c:3537 do_filp_open+0x177/0x250 fs/namei.c:3567 do_sys_open+0x1dd/0x350 fs/open.c:1085 __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 6594: 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 vhci_release+0xa7/0xe0 drivers/bluetooth/hci_vhci.c:360 __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 The buggy address belongs to the object at ffff88808edba280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 128 bytes inside of 512-byte region [ffff88808edba280, ffff88808edba480) The buggy address belongs to the page: page:ffffea00023b6e80 count:1 mapcount:0 mapping:ffff88812c29c940 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea00027e6b88 ffffea000244ca48 ffff88812c29c940 raw: 0000000000000000 ffff88808edba000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808edba200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808edba280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808edba300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808edba380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808edba400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================