bisecting fixing commit since 13af6c74b14a883366e7702c40c52ff548096e7f building syzkaller on 96dd36234d97bbf6b403f3a7f03cfc0296422879 testing commit 13af6c74b14a883366e7702c40c52ff548096e7f with gcc (GCC) 8.4.1 20210217 kernel signature: b70f155c43a58571a986316b381b9e382b53d4d239fa268db311b0d0a751131e run #0: crashed: KASAN: use-after-free Read in hci_dev_reset run #1: crashed: KASAN: use-after-free Read in hci_dev_reset run #2: crashed: KASAN: use-after-free Read in skb_dequeue run #3: crashed: KASAN: use-after-free Read in skb_dequeue run #4: crashed: KASAN: use-after-free Read in skb_dequeue run #5: crashed: KASAN: use-after-free Read in skb_dequeue run #6: crashed: KASAN: use-after-free Read in hci_dev_reset run #7: OK run #8: OK run #9: OK run #10: OK run #11: OK run #12: OK run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK reproducer seems to be flaky testing current HEAD 2d19be4653f5e74ed95560b69f94eb6791d49af3 testing commit 2d19be4653f5e74ed95560b69f94eb6791d49af3 with gcc (GCC) 8.4.1 20210217 kernel signature: 78626bcf62d71afe71b6ef0640b1dff9d3ec08ea933137d2f447d784200154f5 run #0: crashed: KASAN: use-after-free Read in hci_dev_reset run #1: crashed: KASAN: use-after-free Read in hci_dev_reset run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK run #10: OK run #11: OK run #12: OK run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK Reproducer flagged being flaky revisions tested: 2, total time: 35m25.015058841s (build: 16m31.740294757s, test: 17m55.320359516s) the crash still happens on HEAD commit msg: Linux 4.19.177 crash: KASAN: use-after-free Read in hci_dev_reset 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 __lock_acquire+0x31e7/0x47c0 kernel/locking/lockdep.c:3294 Read of size 8 at addr ffff8881d5110840 by task syz-executor.1/16148 CPU: 0 PID: 16148 Comm: syz-executor.1 Not tainted 4.19.177-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/0x226 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 mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __lock_acquire+0x31e7/0x47c0 kernel/locking/lockdep.c:3294 lock_acquire+0x180/0x3a0 kernel/locking/lockdep.c:3907 __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0xf5/0x1200 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 drain_workqueue+0x22/0x3a0 kernel/workqueue.c:2820 hci_dev_do_reset net/bluetooth/hci_core.c:1764 [inline] hci_dev_reset+0x118/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:0x464709 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2a2a2c3188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000055bfa0 RCX: 0000000000464709 RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000004 RBP: 00000000004ae608 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bfa0 R13: 00007ffd4ed774cf R14: 00007f2a2a2c3300 R15: 0000000000022000 Allocated by task 7104: 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 __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15d/0x3d0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] kzalloc include/linux/slab.h:709 [inline] __alloc_workqueue_key+0x5b9/0xbb0 kernel/workqueue.c:4091 hci_register_dev+0x185/0x750 net/bluetooth/hci_core.c:3179 __vhci_create_device+0x269/0x4f0 drivers/bluetooth/hci_vhci.c:139 vhci_create_device drivers/bluetooth/hci_vhci.c:163 [inline] vhci_open_timeout+0x34/0x50 drivers/bluetooth/hci_vhci.c:319 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2152 worker_thread+0x85/0xb60 kernel/workqueue.c:2295 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 15089: 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_free_wq+0x99/0xf0 kernel/workqueue.c:3336 __rcu_reclaim kernel/rcu/rcu.h:236 [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+0x93a/0x19b0 kernel/rcu/tree.c:2881 __do_softirq+0x25f/0x919 kernel/softirq.c:292 The buggy address belongs to the object at ffff8881d51107c0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 128 bytes inside of 512-byte region [ffff8881d51107c0, ffff8881d51109c0) The buggy address belongs to the page: page:ffffea0007544400 count:1 mapcount:0 mapping:ffff8881f6400940 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea0007cba0c8 ffffea000770a4c8 ffff8881f6400940 raw: 0000000000000000 ffff8881d5110040 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d5110700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d5110780: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8881d5110800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d5110880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d5110900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================