bisecting fixing commit since d18b78abc0c6e7d3119367c931c583e02d466495 building syzkaller on 6436ce4bcd8e2c7dcca0b171ac91f51e96d973f8 testing commit d18b78abc0c6e7d3119367c931c583e02d466495 with gcc (GCC) 8.4.1 20210217 kernel signature: f0a8cef9c53dfc8a0b09a7b90bdc3606e7505c1ca0b8911b582032b060ab3c51 run #0: crashed: WARNING: ODEBUG bug in bt_host_release run #1: crashed: WARNING: ODEBUG bug in bt_host_release run #2: crashed: general protection fault in __queue_work run #3: crashed: general protection fault in __queue_work run #4: crashed: WARNING: ODEBUG bug in bt_host_release run #5: crashed: KASAN: use-after-free Read in __queue_work run #6: crashed: KASAN: use-after-free Read in __queue_work run #7: crashed: WARNING: ODEBUG bug in bt_host_release 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 2965db2e004cf9c92b87c1f559e9812c0ae878c1 testing commit 2965db2e004cf9c92b87c1f559e9812c0ae878c1 with gcc (GCC) 8.4.1 20210217 kernel signature: 7842c9c273b4803bf0d940cbf682a97e17e3d658b141cc630c1b49d90d079876 run #0: crashed: WARNING: ODEBUG bug in bt_host_release run #1: crashed: WARNING: ODEBUG bug in bt_host_release run #2: crashed: KASAN: use-after-free Read in __queue_work run #3: crashed: general protection fault in __queue_work run #4: crashed: KASAN: use-after-free Read in __queue_work run #5: crashed: WARNING: ODEBUG bug in bt_host_release run #6: crashed: WARNING: ODEBUG bug in bt_host_release 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: crashed: KASAN: use-after-free Read in __queue_work run #16: OK run #17: OK run #18: OK run #19: OK Reproducer flagged being flaky revisions tested: 2, total time: 43m48.950652843s (build: 24m34.790298253s, test: 18m26.272417202s) the crash still happens on HEAD commit msg: Linux 4.19.188 crash: KASAN: use-after-free Read in __queue_work ================================================================== BUG: KASAN: use-after-free in __queue_work+0xa20/0xdd0 kernel/workqueue.c:1382 Read of size 4 at addr ffff8881e0da2680 by task syz-executor.2/22472 CPU: 0 PID: 22472 Comm: syz-executor.2 Not tainted 4.19.188-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_load4_noabort+0x14/0x20 mm/kasan/report.c:432 __queue_work+0xa20/0xdd0 kernel/workqueue.c:1382 queue_work_on+0x140/0x180 kernel/workqueue.c:1488 queue_work include/linux/workqueue.h:512 [inline] req_run+0x2b2/0x590 net/bluetooth/hci_request.c:87 hci_req_run_skb net/bluetooth/hci_request.c:99 [inline] __hci_req_sync+0x1bb/0x830 net/bluetooth/hci_request.c:212 hci_req_sync+0x70/0xb0 net/bluetooth/hci_request.c:279 hci_dev_cmd+0x1a7/0x6b0 net/bluetooth/hci_core.c:1936 hci_sock_ioctl+0x4b2/0x600 net/bluetooth/hci_sock.c:1045 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:0x465029 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:00007f8622eb9188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000055cfa0 RCX: 0000000000465029 RDX: 0000000020000040 RSI: 00000000400448dd RDI: 0000000000000004 RBP: 00000000004af6d2 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055cfa0 R13: 00007fff8c1c514f R14: 00007f8622eb9300 R15: 0000000000022000 Allocated by task 2865: 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:3181 __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 18: 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 ffff8881e0da2500 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 384 bytes inside of 512-byte region [ffff8881e0da2500, ffff8881e0da2700) The buggy address belongs to the page: page:ffffea0007836880 count:1 mapcount:0 mapping:ffff8881f6400940 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea0007d293c8 ffffea00077de988 ffff8881f6400940 raw: 0000000000000000 ffff8881e0da2000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881e0da2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e0da2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881e0da2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e0da2700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e0da2780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 22472 Comm: syz-executor.2 Tainted: G B 4.19.188-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__queue_work+0x151/0xdd0 kernel/workqueue.c:1403 Code: e8 74 d2 ee ff 4c 89 ef 89 c6 e8 ea 80 ff ff 4c 89 e7 48 89 c3 e8 cf dc ff ff 48 85 c0 0f 84 ad 02 00 00 48 89 da 48 c1 ea 03 <42> 80 3c 32 00 0f 85 3e 0b 00 00 48 39 03 0f 85 bd 04 00 00 48 89 RSP: 0018:ffff8881c80276a0 EFLAGS: 00010046 RAX: ffff8881f28b7b00 RBX: 0000000000000000 RCX: ffff8881f6000068 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000000 RBP: ffff8881c8027710 R08: ffffffff8855afa0 R09: ffffffff8855afe0 R10: 0000000000000000 R11: 0000000000000040 R12: ffff8881e1838da8 R13: ffff8881e0da2500 R14: dffffc0000000000 R15: 0000000000000000 FS: 00007f8622eb9700(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055e71f5af140 CR3: 00000001dfc1e001 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: queue_work_on+0x140/0x180 kernel/workqueue.c:1488 queue_work include/linux/workqueue.h:512 [inline] req_run+0x2b2/0x590 net/bluetooth/hci_request.c:87 hci_req_run_skb net/bluetooth/hci_request.c:99 [inline] __hci_req_sync+0x1bb/0x830 net/bluetooth/hci_request.c:212 hci_req_sync+0x70/0xb0 net/bluetooth/hci_request.c:279 hci_dev_cmd+0x1a7/0x6b0 net/bluetooth/hci_core.c:1936 hci_sock_ioctl+0x4b2/0x600 net/bluetooth/hci_sock.c:1045 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:0x465029 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:00007f8622eb9188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000055cfa0 RCX: 0000000000465029 RDX: 0000000020000040 RSI: 00000000400448dd RDI: 0000000000000004 RBP: 00000000004af6d2 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055cfa0 R13: 00007fff8c1c514f R14: 00007f8622eb9300 R15: 0000000000022000 Modules linked in: ---[ end trace fe597733e50366ef ]--- RIP: 0010:__queue_work+0x151/0xdd0 kernel/workqueue.c:1403 Code: e8 74 d2 ee ff 4c 89 ef 89 c6 e8 ea 80 ff ff 4c 89 e7 48 89 c3 e8 cf dc ff ff 48 85 c0 0f 84 ad 02 00 00 48 89 da 48 c1 ea 03 <42> 80 3c 32 00 0f 85 3e 0b 00 00 48 39 03 0f 85 bd 04 00 00 48 89 RSP: 0018:ffff8881c80276a0 EFLAGS: 00010046 RAX: ffff8881f28b7b00 RBX: 0000000000000000 RCX: ffff8881f6000068 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000000 RBP: ffff8881c8027710 R08: ffffffff8855afa0 R09: ffffffff8855afe0 R10: 0000000000000000 R11: 0000000000000040 R12: ffff8881e1838da8 R13: ffff8881e0da2500 R14: dffffc0000000000 R15: 0000000000000000 FS: 00007f8622eb9700(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055e71f5af140 CR3: 00000001dfc1e001 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400