bisecting fixing commit since c076c79e03c6094e578df5d210fde808b3ad32e6 building syzkaller on 4ca1c0ea446d2c09b1fb49a85ae645e3754f1058 testing commit c076c79e03c6094e578df5d210fde808b3ad32e6 with gcc (GCC) 8.1.0 kernel signature: f7ff8b63f58641d0cddf9b4b7725175292c0f8a5dab1c3082e0cf947850defe4 run #0: crashed: KASAN: use-after-free Write in hci_conn_del run #1: crashed: KASAN: use-after-free 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: use-after-free Write in hci_conn_del run #6: crashed: KASAN: use-after-free Read in __queue_work 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 Write in hci_conn_del testing current HEAD daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b testing commit daefdc9eb24bfa11ab77a4b2a9c3923f1051fe0b with gcc (GCC) 8.1.0 kernel signature: e565bc47926689c1788144a009c1328b544dff53f172b528c1c9d648c8efe029 run #0: crashed: KASAN: use-after-free Write in hci_conn_del run #1: crashed: KASAN: use-after-free Write in hci_conn_del run #2: crashed: KASAN: use-after-free Write in hci_conn_del run #3: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #4: crashed: KASAN: slab-out-of-bounds Write in hci_conn_del run #5: crashed: KASAN: use-after-free Write in hci_conn_del run #6: crashed: KASAN: use-after-free 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: 37m28.143911968s (build: 22m27.367594938s, test: 14m14.587545743s) the crash still happens on HEAD commit msg: Linux 4.19.161 crash: KASAN: use-after-free Read in __queue_work batman_adv: batadv0: Removing interface: batadv_slave_1 device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state Bluetooth: hci0: command 0x0405 tx timeout ================================================================== BUG: KASAN: use-after-free in __queue_work+0xa2e/0xdf0 kernel/workqueue.c:1383 Read of size 4 at addr ffff8881e2132480 by task kworker/0:0/5 CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 4.19.161-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events hci_cmd_timeout 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_load4_noabort+0x14/0x20 mm/kasan/report.c:432 __queue_work+0xa2e/0xdf0 kernel/workqueue.c:1383 queue_work_on+0x140/0x180 kernel/workqueue.c:1488 queue_work include/linux/workqueue.h:512 [inline] hci_cmd_timeout+0x163/0x1d0 net/bluetooth/hci_core.c:2582 process_one_work+0x7b9/0x15a0 kernel/workqueue.c:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 5: 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:4087 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:2155 worker_thread+0x85/0xb60 kernel/workqueue.c:2298 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 21287: 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:3339 __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+0x25e/0x92d kernel/softirq.c:292 The buggy address belongs to the object at ffff8881e2132300 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 384 bytes inside of 512-byte region [ffff8881e2132300, ffff8881e2132500) The buggy address belongs to the page: page:ffffea0007884c80 count:1 mapcount:0 mapping:ffff8881f6400940 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea0007a595c8 ffffea0007b82248 ffff8881f6400940 raw: 0000000000000000 ffff8881e2132080 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881e2132380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e2132400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881e2132480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e2132500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e2132580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================