Bluetooth: hci0: Opcode 0x0c03 failed: -110 ================================================================== BUG: KASAN: slab-use-after-free in set_powered_sync+0x40/0xdc net/bluetooth/mgmt.c:1353 Read of size 8 at addr ffff0000d8c08918 by task kworker/u9:5/6431 CPU: 1 UID: 0 PID: 6431 Comm: kworker/u9:5 Not tainted 6.12.0-rc6-syzkaller-g8936d33c1f69 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: hci0 hci_cmd_sync_work Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 set_powered_sync+0x40/0xdc net/bluetooth/mgmt.c:1353 hci_cmd_sync_work+0x1cc/0x34c net/bluetooth/hci_sync.c:332 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Allocated by task 7533: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __kmalloc_cache_noprof+0x244/0x378 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] mgmt_pending_new+0x70/0x248 net/bluetooth/mgmt_util.c:269 mgmt_pending_add+0x48/0x11c net/bluetooth/mgmt_util.c:296 set_powered+0x314/0x4e8 net/bluetooth/mgmt.c:1394 hci_mgmt_cmd+0x980/0xe64 net/bluetooth/hci_sock.c:1712 hci_sock_sendmsg+0x590/0xd14 net/bluetooth/hci_sock.c:1832 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg net/socket.c:744 [inline] sock_write_iter+0x2d8/0x448 net/socket.c:1165 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x920/0xcf4 fs/read_write.c:683 ksys_write+0x15c/0x26c fs/read_write.c:736 __do_sys_write fs/read_write.c:748 [inline] __se_sys_write fs/read_write.c:745 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:745 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Freed by task 6431: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x64/0x8c mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x184/0x47c mm/slub.c:4727 mgmt_pending_free+0xc8/0x118 net/bluetooth/mgmt_util.c:309 settings_rsp+0x274/0x35c net/bluetooth/mgmt.c:1443 mgmt_pending_foreach+0xd0/0x144 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x10c/0x3d4 net/bluetooth/mgmt.c:9460 hci_dev_close_sync+0x52c/0x10c0 net/bluetooth/hci_sync.c:5201 hci_dev_do_close net/bluetooth/hci_core.c:483 [inline] hci_error_reset+0x108/0x35c net/bluetooth/hci_core.c:1016 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 The buggy address belongs to the object at ffff0000d8c08900 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 24 bytes inside of freed 96-byte region [ffff0000d8c08900, ffff0000d8c08960) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x118c08 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000000 ffff0000c0001280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000200020 00000001f5000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d8c08800: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff0000d8c08880: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff0000d8c08900: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff0000d8c08980: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff0000d8c08a00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ================================================================== Bluetooth: hci2: command tx timeout Bluetooth: hci5: command tx timeout Bluetooth: hci2: command tx timeout Bluetooth: hci5: command tx timeout Bluetooth: hci5: command tx timeout