bisecting fixing commit since d7e78d08fa77acdea351c8f628f49ca9a0e1029a building syzkaller on 816e0689d7d9d8321f8bf360740f0e516aee15ca testing commit d7e78d08fa77acdea351c8f628f49ca9a0e1029a with gcc (GCC) 8.1.0 kernel signature: 061b044edd84c0df2f264d8130a6ae45851a92e6461c6e863759573581e2623c run #0: crashed: KASAN: use-after-free Read in __queue_work run #1: crashed: WARNING: ODEBUG bug in bt_host_release run #2: crashed: WARNING: ODEBUG bug in bt_host_release run #3: crashed: WARNING: ODEBUG bug in bt_host_release run #4: crashed: INFO: task hung in hci_req_sync run #5: crashed: WARNING: ODEBUG bug in bt_host_release run #6: OK run #7: OK run #8: OK run #9: OK testing current HEAD 3f2ecb86cb909da0b9157fd2952ad79924cbe5ae testing commit 3f2ecb86cb909da0b9157fd2952ad79924cbe5ae with gcc (GCC) 8.1.0 kernel signature: 4019e51a2831c28129946c33a09fd78a61d74af2199d4fed973c4bba72419f6c run #0: crashed: WARNING: ODEBUG bug in bt_host_release run #1: crashed: KASAN: use-after-free Read in __queue_work run #2: OK run #3: OK run #4: OK run #5: OK run #6: OK run #7: OK run #8: OK run #9: OK reproducer seems to be flaky Reproducer flagged being flaky revisions tested: 2, total time: 39m32.780992328s (build: 17m54.353102371s, test: 20m51.602913999s) the crash still happens on HEAD commit msg: Linux 4.14.212 crash: KASAN: use-after-free Read in __queue_work ================================================================== BUG: KASAN: use-after-free in __queue_work+0xa97/0xea0 kernel/workqueue.c:1385 Read of size 4 at addr ffff8881e3377e00 by task syz-executor.2/30829 CPU: 1 PID: 30829 Comm: syz-executor.2 Not tainted 4.14.212-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 __queue_work+0xa97/0xea0 kernel/workqueue.c:1385 queue_work_on+0x140/0x180 kernel/workqueue.c:1490 queue_work include/linux/workqueue.h:491 [inline] req_run+0x2b2/0x590 net/bluetooth/hci_request.c:77 hci_req_run_skb net/bluetooth/hci_request.c:89 [inline] __hci_req_sync+0x297/0x7d0 net/bluetooth/hci_request.c:214 hci_req_sync+0x70/0xb0 net/bluetooth/hci_request.c:285 hci_inquiry+0x57d/0x790 net/bluetooth/hci_core.c:1272 hci_sock_ioctl+0x199/0x600 net/bluetooth/hci_sock.c:1043 sock_do_ioctl+0x62/0xa0 net/socket.c:974 sock_ioctl+0x251/0x430 net/socket.c:1071 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x180/0xfb0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x74/0x80 fs/ioctl.c:692 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45d5b9 RSP: 002b:00007fc7357f7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000000f2c0 RCX: 000000000045d5b9 RDX: 0000000020000200 RSI: 00000000800448f0 RDI: 0000000000000004 RBP: 000000000118d0c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118d08c R13: 00007fff2ed1810f R14: 00007fc7357f89c0 R15: 000000000118d08c Allocated by task 3: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15d/0x410 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] kzalloc include/linux/slab.h:661 [inline] __alloc_workqueue_key+0xf8/0xc80 kernel/workqueue.c:3996 hci_register_dev+0x182/0x750 net/bluetooth/hci_core.c:3099 __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+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Freed by task 0: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 rcu_free_wq+0x99/0xf0 kernel/workqueue.c:3279 __rcu_reclaim kernel/rcu/rcu.h:195 [inline] rcu_do_batch kernel/rcu/tree.c:2699 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline] rcu_process_callbacks+0x7a5/0x11e0 kernel/rcu/tree.c:2946 __do_softirq+0x246/0x9b5 kernel/softirq.c:288 The buggy address belongs to the object at ffff8881e3377c80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 384 bytes inside of 512-byte region [ffff8881e3377c80, ffff8881e3377e80) The buggy address belongs to the page: page:ffffea00078cddc0 count:1 mapcount:0 mapping:ffff8881e3377000 index:0xffff8881e3377280 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881e3377000 ffff8881e3377280 0000000100000002 raw: ffffea000757cfe0 ffffea000765fd60 ffff8881f6000940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881e3377d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e3377d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881e3377e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e3377e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e3377f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================