================================================================== BUG: KASAN: slab-use-after-free in set_powered_sync+0x40/0xdc net/bluetooth/mgmt.c:1353 Read of size 8 at addr ffff0000d56afb18 by task kworker/u9:6/6417 CPU: 0 UID: 0 PID: 6417 Comm: kworker/u9:6 Not tainted 6.11.0-rc5-syzkaller-gdf54f4a16f82 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci0 hci_cmd_sync_work Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 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:328 process_one_work+0x79c/0x15b8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x978/0xec4 kernel/workqueue.c:3389 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Allocated by task 6714: 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:370 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __kmalloc_cache_noprof+0x244/0x374 mm/slub.c:4189 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [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:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x2d8/0x448 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x940/0xc80 fs/read_write.c:590 ksys_write+0x15c/0x26c fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:652 __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:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Freed by task 6723: 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+0x128/0x180 mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x154/0x3e0 mm/slub.c:4594 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+0x114/0x3dc net/bluetooth/mgmt.c:9448 hci_dev_close_sync+0x4e0/0x1074 net/bluetooth/hci_sync.c:5153 hci_dev_do_close net/bluetooth/hci_core.c:483 [inline] hci_dev_close+0xe4/0x20c net/bluetooth/hci_core.c:508 hci_sock_ioctl+0x418/0x7e8 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x134/0x2d0 net/socket.c:1222 sock_ioctl+0x4ec/0x838 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:893 __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:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000d56afb00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 24 bytes inside of freed 96-byte region [ffff0000d56afb00, ffff0000d56afb60) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1156af anon flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 05ffc00000000000 ffff0000c0001280 fffffdffc333aac0 dead000000000005 raw: 0000000000000000 0000000080200020 00000001fdffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d56afa00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff0000d56afa80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff0000d56afb00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff0000d56afb80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff0000d56afc00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ==================================================================