Bluetooth: hci3: Injecting HCI hardware error event ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline] BUG: KASAN: use-after-free in hci_recv_frame+0x3c/0x1e0 net/bluetooth/hci_core.c:4135 Read of size 8 at addr ffff88805e26c0a8 by task kworker/1:9/4026 CPU: 1 PID: 4026 Comm: kworker/1:9 Not tainted 5.15.160-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: events hci_ncmd_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline] hci_recv_frame+0x3c/0x1e0 net/bluetooth/hci_core.c:4135 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 Allocated by task 11631: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] hci_alloc_dev_priv+0x23/0x1d60 net/bluetooth/hci_core.c:3775 hci_alloc_dev include/net/bluetooth/hci_core.h:1247 [inline] __vhci_create_device drivers/bluetooth/hci_vhci.c:102 [inline] vhci_create_device+0x120/0x590 drivers/bluetooth/hci_vhci.c:153 vhci_get_user drivers/bluetooth/hci_vhci.c:210 [inline] vhci_write+0x382/0x430 drivers/bluetooth/hci_vhci.c:290 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xacf/0xe50 fs/read_write.c:594 ksys_write+0x1a2/0x2c0 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 11631: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xf1/0x270 mm/slub.c:4559 hci_release_dev+0x149e/0x1620 net/bluetooth/hci_core.c:4092 bt_host_release+0x7f/0x90 net/bluetooth/hci_sysfs.c:92 device_release+0x91/0x1c0 kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x224/0x460 lib/kobject.c:761 vhci_release+0x7b/0xc0 drivers/bluetooth/hci_vhci.c:346 __fput+0x3bf/0x890 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x6a3/0x2480 kernel/exit.c:872 do_group_exit+0x144/0x310 kernel/exit.c:994 __do_sys_exit_group kernel/exit.c:1005 [inline] __se_sys_exit_group kernel/exit.c:1003 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1003 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1366 __queue_work+0x963/0xd00 kernel/workqueue.c:1532 call_timer_fn+0x16d/0x560 kernel/time/timer.c:1451 expire_timers kernel/time/timer.c:1491 [inline] __run_timers+0x6a8/0x890 kernel/time/timer.c:1767 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1780 __do_softirq+0x3b3/0x93a kernel/softirq.c:558 Second to last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1366 __queue_work+0x963/0xd00 kernel/workqueue.c:1532 queue_work_on+0x14b/0x250 kernel/workqueue.c:1559 queue_work include/linux/workqueue.h:512 [inline] hci_recv_frame+0x18a/0x1e0 net/bluetooth/hci_core.c:4156 vhci_get_user drivers/bluetooth/hci_vhci.c:194 [inline] vhci_write+0x31a/0x430 drivers/bluetooth/hci_vhci.c:290 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xacf/0xe50 fs/read_write.c:594 ksys_write+0x1a2/0x2c0 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80