Bluetooth: hci0: Opcode 0x0c03 failed: -110 ================================================================== BUG: KASAN: slab-use-after-free in set_powered_sync+0xc1/0xd0 net/bluetooth/mgmt.c:1353 Read of size 8 at addr ffff888029b0d098 by task kworker/u33:0/12100 CPU: 1 PID: 12100 Comm: kworker/u33:0 Not tainted 6.10.0-syzkaller-08676-g720261cfc732 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: hci0 hci_cmd_sync_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 set_powered_sync+0xc1/0xd0 net/bluetooth/mgmt.c:1353 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:328 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 16902: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] mgmt_pending_new+0x5b/0x290 net/bluetooth/mgmt_util.c:269 mgmt_pending_add+0x36/0x160 net/bluetooth/mgmt_util.c:296 set_powered+0x28c/0x5c0 net/bluetooth/mgmt.c:1394 hci_mgmt_cmd net/bluetooth/hci_sock.c:1712 [inline] hci_sock_sendmsg+0x1528/0x25e0 net/bluetooth/hci_sock.c:1832 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x50a/0x5c0 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x1f8/0x260 fs/read_write.c:643 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 12100: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2235 [inline] slab_free mm/slub.c:4464 [inline] kfree+0x12a/0x3b0 mm/slub.c:4585 settings_rsp+0x257/0x400 net/bluetooth/mgmt.c:1443 mgmt_pending_foreach+0xdf/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0xcd/0x2e0 net/bluetooth/mgmt.c:9444 hci_dev_close_sync+0xcb8/0x11d0 net/bluetooth/hci_sync.c:5118 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:490 hci_error_reset+0xbf/0x320 net/bluetooth/hci_core.c:1023 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888029b0d080 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 24 bytes inside of freed 96-byte region [ffff888029b0d080, ffff888029b0d0e0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29b0d anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000000 ffff888015442280 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000200020 00000001ffffefff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 1092, tgid 1092 (kworker/u32:8), ts 63765514763, free_ts 63579873079 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2304 allocate_slab mm/slub.c:2467 [inline] new_slab+0x84/0x260 mm/slub.c:2520 ___slab_alloc+0xdac/0x1870 mm/slub.c:3706 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3796 __slab_alloc_node mm/slub.c:3849 [inline] slab_alloc_node mm/slub.c:4016 [inline] __kmalloc_cache_noprof+0x2c5/0x310 mm/slub.c:4175 kmalloc_noprof include/linux/slab.h:681 [inline] dst_cow_metrics_generic+0x4c/0x1f0 net/core/dst.c:178 dst_metrics_write_ptr include/net/dst.h:133 [inline] dst_metric_set include/net/dst.h:194 [inline] icmp6_dst_alloc+0x370/0x4a0 net/ipv6/route.c:3288 ndisc_send_skb+0x1279/0x1c30 net/ipv6/ndisc.c:489 ndisc_send_ns+0xc7/0x150 net/ipv6/ndisc.c:667 addrconf_dad_work+0xca5/0x1500 net/ipv6/addrconf.c:4282 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 page last free pid 5285 tgid 5284 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2588 __put_partials+0x14c/0x170 mm/slub.c:3034 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3979 [inline] slab_alloc_node mm/slub.c:4028 [inline] kmem_cache_alloc_lru_noprof+0x121/0x2f0 mm/slub.c:4047 alloc_inode+0xba/0x230 fs/inode.c:265 new_inode_pseudo fs/inode.c:1028 [inline] new_inode+0x22/0x210 fs/inode.c:1047 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x11a/0x660 fs/debugfs/inode.c:425 kvm_create_vm_debugfs arch/x86/kvm/../../../virt/kvm/kvm_main.c:1090 [inline] kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1236 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:5421 [inline] kvm_dev_ioctl+0x1628/0x1c60 arch/x86/kvm/../../../virt/kvm/kvm_main.c:5463 __do_compat_sys_ioctl+0x2c3/0x330 fs/ioctl.c:1007 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff888029b0cf80: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff888029b0d000: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff888029b0d080: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888029b0d100: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888029b0d180: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================