bisecting fixing commit since 14b58326976de6ef3998eefec1dd7f8b38b97a75 building syzkaller on ff51e5229e0ee846d2fd687cb0dbca13de758c66 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.1.0 kernel signature: 17fecd6f021a7d2935ae24c6a910e3d18d2c8a20b791be210014ebc8887af317 run #0: crashed: KASAN: use-after-free Write in hci_conn_del run #1: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #2: crashed: KASAN: use-after-free Write in hci_conn_del run #3: crashed: KASAN: use-after-free Write in hci_conn_del run #4: crashed: KASAN: use-after-free Write in hci_conn_del run #5: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #6: crashed: KASAN: use-after-free Read in __queue_work run #7: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #8: crashed: KASAN: use-after-free Write in hci_conn_del run #9: crashed: KASAN: use-after-free Write in hci_conn_del testing current HEAD c196b3a9c83ae3491280b739d231d02b3cb9d041 testing commit c196b3a9c83ae3491280b739d231d02b3cb9d041 with gcc (GCC) 8.1.0 kernel signature: d289b51321b0098c065ec5b1bc0e746f0fbed5bcd34d426b7c39aa2757078bfc run #0: crashed: KASAN: use-after-free Write in hci_conn_del run #1: crashed: possible deadlock in hci_dev_do_close run #2: crashed: KASAN: use-after-free Write in hci_conn_del run #3: crashed: KASAN: use-after-free Read in __queue_work run #4: crashed: KASAN: use-after-free Write in hci_conn_del run #5: crashed: KASAN: use-after-free Write in hci_conn_del run #6: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #7: crashed: KASAN: use-after-free Write in hci_conn_del run #8: crashed: KASAN: use-after-free Write in hci_conn_del run #9: crashed: KASAN: use-after-free Read in __queue_work revisions tested: 2, total time: 28m38.345482147s (build: 16m51.182513487s, test: 11m16.885360564s) the crash still happens on HEAD commit msg: Linux 4.14.210 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 ffff8881df6ce400 by task syz-executor.4/8225 CPU: 0 PID: 8225 Comm: syz-executor.4 Not tainted 4.14.210-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_delayed_work+0x1a5/0x2d0 kernel/workqueue.c:1527 queue_delayed_work_on+0x148/0x180 kernel/workqueue.c:1563 queue_delayed_work include/linux/workqueue.h:506 [inline] hci_conn_drop include/net/bluetooth/hci_core.h:986 [inline] sco_chan_del+0x1a0/0x3c0 net/bluetooth/sco.c:148 __sco_sock_close+0x2d7/0x500 net/bluetooth/sco.c:433 sco_sock_close+0x26/0x40 net/bluetooth/sco.c:447 sco_sock_release+0x43/0x200 net/bluetooth/sco.c:1009 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 get_signal+0x1460/0x1ab0 kernel/signal.c:2234 do_signal+0x7f/0x18b0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x11e/0x190 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45ce79 RSP: 002b:00007f5cc878cc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffffc RBX: 0000000000002180 RCX: 000000000045ce79 RDX: 0000000000000008 RSI: 0000000020000140 RDI: 0000000000000006 RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007ffc620a1b0f R14: 00007f5cc878d9c0 R15: 000000000118bf2c Allocated by task 6731: 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 ffff8881df6ce280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 384 bytes inside of 512-byte region [ffff8881df6ce280, ffff8881df6ce480) The buggy address belongs to the page: page:ffffea00077db380 count:1 mapcount:0 mapping:ffff8881df6ce000 index:0xffff8881df6cea00 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881df6ce000 ffff8881df6cea00 0000000100000004 raw: ffffea00075aa3e0 ffffea0007a47520 ffff8881f6000940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881df6ce300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881df6ce380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881df6ce400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881df6ce480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881df6ce500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================