Bluetooth: hci0: Opcode 0x206a failed: -110 ================================================================== BUG: KASAN: slab-use-after-free in set_powered_sync+0xc1/0xd0 net/bluetooth/mgmt.c:1354 Read of size 8 at addr ffff888047369b98 by task kworker/u33:0/66 CPU: 0 PID: 66 Comm: kworker/u33:0 Not tainted 6.10.0-syzkaller #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:1354 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:323 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3248 process_scheduled_works kernel/workqueue.c:3329 [inline] worker_thread+0x6c8/0xf30 kernel/workqueue.c:3409 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 6921: 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:660 [inline] kzalloc_noprof include/linux/slab.h:778 [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:1395 hci_mgmt_cmd net/bluetooth/hci_sock.c:1712 [inline] hci_sock_sendmsg+0x1526/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 6956: 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:2196 [inline] slab_free mm/slub.c:4438 [inline] kfree+0x12a/0x3b0 mm/slub.c:4559 cmd_status_rsp net/bluetooth/mgmt.c:1452 [inline] cmd_complete_rsp+0x119/0x160 net/bluetooth/mgmt.c:1466 mgmt_pending_foreach+0xdf/0x140 net/bluetooth/mgmt_util.c:259 mgmt_index_removed+0x11f/0x2e0 net/bluetooth/mgmt.c:9346 hci_sock_bind+0xc6d/0x1810 net/bluetooth/hci_sock.c:1307 __sys_bind+0x1f3/0x220 net/socket.c:1847 __do_sys_bind net/socket.c:1858 [inline] __se_sys_bind net/socket.c:1856 [inline] __ia32_sys_bind+0x71/0xb0 net/socket.c:1856 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 The buggy address belongs to the object at ffff888047369b80 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 24 bytes inside of freed 96-byte region [ffff888047369b80, ffff888047369be0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888047369800 pfn:0x47369 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 04fff00000000000 ffff888015442280 ffffea000111a180 dead000000000004 raw: ffff888047369800 0000000080200013 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 95, tgid 95 (kworker/u32:5), ts 63456464728, free_ts 63220292936 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:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] kmalloc_trace_noprof+0x2c5/0x310 mm/slub.c:4149 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] nsim_fib_event_schedule_work drivers/net/netdevsim/fib.c:990 [inline] nsim_fib_event_nb+0x1b6/0xec0 drivers/net/netdevsim/fib.c:1043 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 atomic_notifier_call_chain+0x71/0x1c0 kernel/notifier.c:231 call_fib_notifiers+0x33/0x70 net/core/fib_notifier.c:35 call_fib6_entry_notifiers net/ipv6/ip6_fib.c:404 [inline] fib6_add_rt2node net/ipv6/ip6_fib.c:1238 [inline] fib6_add+0x25cb/0x4ba0 net/ipv6/ip6_fib.c:1495 __ip6_ins_rt net/ipv6/route.c:1316 [inline] ip6_ins_rt+0xb6/0x110 net/ipv6/route.c:1326 __ipv6_ifa_notify+0x9dc/0xc30 net/ipv6/addrconf.c:6267 ipv6_ifa_notify net/ipv6/addrconf.c:6306 [inline] addrconf_dad_completed+0x19d/0x1060 net/ipv6/addrconf.c:4319 page last free pid 95 tgid 95 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 stack_depot_save_flags+0x2da/0x900 lib/stackdepot.c:666 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48 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:2196 [inline] slab_free mm/slub.c:4438 [inline] kfree+0x12a/0x3b0 mm/slub.c:4559 skb_kfree_head net/core/skbuff.c:1069 [inline] skb_free_head+0x108/0x1d0 net/core/skbuff.c:1081 skb_release_data+0x75c/0x980 net/core/skbuff.c:1108 skb_release_all net/core/skbuff.c:1173 [inline] __kfree_skb net/core/skbuff.c:1187 [inline] kfree_skb_reason+0x12b/0x210 net/core/skbuff.c:1223 kfree_skb include/linux/skbuff.h:1257 [inline] macsec_start_xmit+0x17ba/0x2840 drivers/net/macsec.c:3518 __netdev_start_xmit include/linux/netdevice.h:4882 [inline] netdev_start_xmit include/linux/netdevice.h:4896 [inline] xmit_one net/core/dev.c:3578 [inline] dev_hard_start_xmit+0x143/0x790 net/core/dev.c:3594 __dev_queue_xmit+0x7ba/0x4130 net/core/dev.c:4393 dev_queue_xmit include/linux/netdevice.h:3095 [inline] neigh_hh_output include/net/neighbour.h:526 [inline] neigh_output include/net/neighbour.h:540 [inline] ip6_finish_output2+0x10eb/0x1880 net/ipv6/ip6_output.c:137 __ip6_finish_output net/ipv6/ip6_output.c:211 [inline] ip6_finish_output+0x3f9/0x1300 net/ipv6/ip6_output.c:222 Memory state around the buggy address: ffff888047369a80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888047369b00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff888047369b80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888047369c00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888047369c80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================