bisecting fixing commit since f873db9acd3c92d4741bc3676c9eb511b2f9a6f6 building syzkaller on 6436ce4bcd8e2c7dcca0b171ac91f51e96d973f8 testing commit f873db9acd3c92d4741bc3676c9eb511b2f9a6f6 with gcc (GCC) 8.4.1 20210217 kernel signature: c196333d61055a51843447eddd8c71c128677bd015e04f7517dcaabfa414350b run #0: crashed: WARNING: ODEBUG bug in bt_host_release 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: 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: OK run #16: OK run #17: OK run #18: OK run #19: OK reproducer seems to be flaky testing current HEAD 89698becf06d341a700913c3d89ce2a914af69a2 testing commit 89698becf06d341a700913c3d89ce2a914af69a2 with gcc (GCC) 10.2.1 20210217 kernel signature: 9daba37f8eacfa4f9a17ccd3a0e2ddc9dcb4b1df9ed759c831fbfcd2056ef379 run #0: crashed: WARNING: ODEBUG bug in bt_host_release 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: 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: crashed: WARNING: ODEBUG bug in bt_host_release run #8: crashed: KASAN: use-after-free Read in __queue_work run #9: crashed: KASAN: use-after-free Read in __queue_work 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: 31m33.345785549s (build: 12m30.608865386s, test: 18m10.839072441s) the crash still happens on HEAD commit msg: Merge tag 'm68knommu-for-v5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu crash: KASAN: use-after-free Read in __queue_work ================================================================== BUG: KASAN: use-after-free in __queue_work+0x921/0xc60 kernel/workqueue.c:1417 Read of size 4 at addr ffff88810f3069c0 by task syz-executor.5/20295 CPU: 1 PID: 20295 Comm: syz-executor.5 Not tainted 5.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x10c/0x14b lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 __queue_work+0x921/0xc60 kernel/workqueue.c:1417 queue_work_on+0x101/0x140 kernel/workqueue.c:1524 queue_work include/linux/workqueue.h:507 [inline] req_run+0x28b/0x500 net/bluetooth/hci_request.c:88 hci_req_run_skb net/bluetooth/hci_request.c:100 [inline] __hci_req_sync+0x1b8/0x750 net/bluetooth/hci_request.c:213 hci_req_sync+0x74/0xa0 net/bluetooth/hci_request.c:280 hci_dev_cmd+0x48c/0x740 net/bluetooth/hci_core.c:2051 hci_sock_ioctl+0x313/0x630 net/bluetooth/hci_sock.c:1052 sock_do_ioctl+0xc6/0x210 net/socket.c:1039 sock_ioctl+0x3bf/0x570 net/socket.c:1179 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae 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:00007f11cc8c2188 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: 00007fff443a5b7f R14: 00007f11cc8c2300 R15: 0000000000022000 Allocated by task 6020: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] __kasan_kmalloc+0x78/0x90 mm/kasan/common.c:515 kasan_kmalloc include/linux/kasan.h:233 [inline] __do_kmalloc mm/slab.c:3695 [inline] __kmalloc+0x22f/0x440 mm/slab.c:3704 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:684 [inline] alloc_workqueue+0x798/0xc60 kernel/workqueue.c:4278 hci_register_dev+0x17e/0x990 net/bluetooth/hci_core.c:3882 __vhci_create_device+0x25e/0x520 drivers/bluetooth/hci_vhci.c:124 vhci_create_device drivers/bluetooth/hci_vhci.c:148 [inline] vhci_open_timeout+0x30/0x40 drivers/bluetooth/hci_vhci.c:305 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Freed by task 20279: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xac/0xe0 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] __cache_free mm/slab.c:3440 [inline] kfree+0x10f/0x2d0 mm/slab.c:3796 rcu_do_batch kernel/rcu/tree.c:2559 [inline] rcu_core+0x722/0x14f0 kernel/rcu/tree.c:2794 __do_softirq+0x206/0xa44 kernel/softirq.c:345 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0x87/0xb0 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:3039 [inline] call_rcu+0x118/0x7c0 kernel/rcu/tree.c:3114 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0x87/0xb0 mm/kasan/generic.c:345 kvfree_call_rcu+0x14a/0x7c0 kernel/rcu/tree.c:3577 batadv_hardif_release net/batman-adv/hard-interface.c:55 [inline] kref_put include/linux/kref.h:65 [inline] batadv_hardif_put net/batman-adv/hard-interface.h:93 [inline] batadv_hard_if_event+0xc8a/0x1150 net/batman-adv/hard-interface.c:1048 notifier_call_chain+0x94/0x170 kernel/notifier.c:83 call_netdevice_notifiers_extack net/core/dev.c:2087 [inline] call_netdevice_notifiers net/core/dev.c:2101 [inline] unregister_netdevice_many+0x7eb/0x1520 net/core/dev.c:10935 default_device_exit_batch+0x2a5/0x360 net/core/dev.c:11455 cleanup_net+0x423/0x990 net/core/net_namespace.c:595 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff88810f306800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 448 bytes inside of 1024-byte region [ffff88810f306800, ffff88810f306c00) The buggy address belongs to the page: page:00000000fcdb085b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10f306 flags: 0x17ffe0000000200(slab) raw: 017ffe0000000200 ffffea0004718888 ffffea00049a4c88 ffff888100040700 raw: 0000000000000000 ffff88810f306000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810f306880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810f306900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810f306980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810f306a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810f306a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 20295 Comm: syz-executor.5 Tainted: G B 5.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__queue_work+0x16a/0xc60 kernel/workqueue.c:1439 Code: eb ff 48 89 df 89 c6 e8 94 64 ff ff 49 89 c7 48 89 ef e8 39 80 ff ff 49 89 c0 4c 89 f8 48 c1 e8 03 4d 85 c0 0f 84 22 01 00 00 <42> 80 3c 30 00 0f 85 cf 08 00 00 4d 39 07 0f 84 1c 01 00 00 4c 89 RSP: 0018:ffffc90002a87950 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff88810f306800 RCX: 0000000000000000 RDX: ffffed1020080008 RSI: 0000000000000005 RDI: ffff888100400090 RBP: ffff88812ce70a88 R08: ffff888107ece800 R09: ffff888100400040 R10: 0000000000000040 R11: 6e696c6261736944 R12: 0000000000000001 R13: ffffed1021e60d38 R14: dffffc0000000000 R15: 0000000000000000 FS: 00007f11cc8c2700(0000) GS:ffff8881f6500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fb61f3ab000 CR3: 0000000125833006 CR4: 00000000001706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: queue_work_on+0x101/0x140 kernel/workqueue.c:1524 queue_work include/linux/workqueue.h:507 [inline] req_run+0x28b/0x500 net/bluetooth/hci_request.c:88 hci_req_run_skb net/bluetooth/hci_request.c:100 [inline] __hci_req_sync+0x1b8/0x750 net/bluetooth/hci_request.c:213 hci_req_sync+0x74/0xa0 net/bluetooth/hci_request.c:280 hci_dev_cmd+0x48c/0x740 net/bluetooth/hci_core.c:2051 hci_sock_ioctl+0x313/0x630 net/bluetooth/hci_sock.c:1052 sock_do_ioctl+0xc6/0x210 net/socket.c:1039 sock_ioctl+0x3bf/0x570 net/socket.c:1179 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae 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:00007f11cc8c2188 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: 00007fff443a5b7f R14: 00007f11cc8c2300 R15: 0000000000022000 Modules linked in: ---[ end trace 8ef279a046a5e916 ]--- RIP: 0010:__queue_work+0x16a/0xc60 kernel/workqueue.c:1439 Code: eb ff 48 89 df 89 c6 e8 94 64 ff ff 49 89 c7 48 89 ef e8 39 80 ff ff 49 89 c0 4c 89 f8 48 c1 e8 03 4d 85 c0 0f 84 22 01 00 00 <42> 80 3c 30 00 0f 85 cf 08 00 00 4d 39 07 0f 84 1c 01 00 00 4c 89 RSP: 0018:ffffc90002a87950 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff88810f306800 RCX: 0000000000000000 RDX: ffffed1020080008 RSI: 0000000000000005 RDI: ffff888100400090 RBP: ffff88812ce70a88 R08: ffff888107ece800 R09: ffff888100400040 R10: 0000000000000040 R11: 6e696c6261736944 R12: 0000000000000001 R13: ffffed1021e60d38 R14: dffffc0000000000 R15: 0000000000000000 FS: 00007f11cc8c2700(0000) GS:ffff8881f6500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fb61f3ab000 CR3: 0000000125833006 CR4: 00000000001706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400