Bluetooth: hci0: Opcode 0x0c1a failed: -110 Bluetooth: hci0: Error when powering off device on rfkill (-110) ================================================================== BUG: KASAN: slab-use-after-free in sco_conn_free net/bluetooth/sco.c:87 [inline] BUG: KASAN: slab-use-after-free in kref_put include/linux/kref.h:65 [inline] BUG: KASAN: slab-use-after-free in sco_conn_put+0x471/0x4c0 net/bluetooth/sco.c:107 Write of size 8 at addr ffff8880285445a0 by task kworker/3:2/5953 CPU: 3 UID: 0 PID: 5953 Comm: kworker/3:2 Not tainted 6.14.0-syzkaller-00685-g3ba7dfb8da62 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events rfkill_op_handler Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xd9/0x110 mm/kasan/report.c:634 sco_conn_free net/bluetooth/sco.c:87 [inline] kref_put include/linux/kref.h:65 [inline] sco_conn_put+0x471/0x4c0 net/bluetooth/sco.c:107 sco_conn_del+0x26f/0x2e0 net/bluetooth/sco.c:271 sco_disconn_cfm+0x76/0xb0 net/bluetooth/sco.c:1436 hci_disconn_cfm include/net/bluetooth/hci_core.h:2044 [inline] hci_conn_hash_flush+0x10b/0x260 net/bluetooth/hci_conn.c:2698 hci_dev_close_sync+0x603/0x11a0 net/bluetooth/hci_sync.c:5197 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483 hci_rfkill_set_block+0x225/0x360 net/bluetooth/hci_core.c:911 rfkill_set_block+0x203/0x560 net/rfkill/core.c:346 rfkill_epo+0x8e/0x1d0 net/rfkill/core.c:466 __rfkill_handle_global_op net/rfkill/input.c:60 [inline] rfkill_op_handler+0x262/0x280 net/rfkill/input.c:108 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 </TASK> Allocated by task 10658: 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:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:902 [inline] kzalloc_noprof include/linux/slab.h:1036 [inline] copy_verifier_state kernel/bpf/verifier.c:1667 [inline] copy_verifier_state+0xad7/0xe70 kernel/bpf/verifier.c:1635 is_state_visited kernel/bpf/verifier.c:18812 [inline] do_check kernel/bpf/verifier.c:18974 [inline] do_check_common+0x459e/0xb960 kernel/bpf/verifier.c:22273 do_check_main kernel/bpf/verifier.c:22364 [inline] bpf_check+0x7801/0xb8c0 kernel/bpf/verifier.c:23160 bpf_prog_load+0xe3c/0x2480 kernel/bpf/syscall.c:2952 __sys_bpf+0x478f/0x49f0 kernel/bpf/syscall.c:5795 __do_sys_bpf kernel/bpf/syscall.c:5902 [inline] __se_sys_bpf kernel/bpf/syscall.c:5900 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5900 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 10658: 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:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2376 [inline] slab_free mm/slub.c:4633 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4832 free_func_state kernel/bpf/verifier.c:1608 [inline] free_func_state kernel/bpf/verifier.c:1603 [inline] free_verifier_state+0xa3/0x1c0 kernel/bpf/verifier.c:1617 free_states kernel/bpf/verifier.c:22154 [inline] do_check_common+0x1eef/0xb960 kernel/bpf/verifier.c:22285 do_check_main kernel/bpf/verifier.c:22364 [inline] bpf_check+0x7801/0xb8c0 kernel/bpf/verifier.c:23160 bpf_prog_load+0xe3c/0x2480 kernel/bpf/syscall.c:2952 __sys_bpf+0x478f/0x49f0 kernel/bpf/syscall.c:5795 __do_sys_bpf kernel/bpf/syscall.c:5902 [inline] __se_sys_bpf kernel/bpf/syscall.c:5900 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5900 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888028544000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1440 bytes inside of freed 2048-byte region [ffff888028544000, ffff888028544800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888028544000 pfn:0x28540 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801b042f00 ffffea0000bf0210 ffffea0000d0f810 raw: ffff888028544000 0000000000080004 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801b042f00 ffffea0000bf0210 ffffea0000d0f810 head: ffff888028544000 0000000000080004 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0000a15001 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5950, tgid 5950 (syz-executor), ts 45670216168, free_ts 45665838890 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4740 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2446 [inline] allocate_slab mm/slub.c:2610 [inline] new_slab+0x23d/0x330 mm/slub.c:2663 ___slab_alloc+0xc37/0x1640 mm/slub.c:3849 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3939 __slab_alloc_node mm/slub.c:4014 [inline] slab_alloc_node mm/slub.c:4175 [inline] __do_kmalloc_node mm/slub.c:4317 [inline] __kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4337 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:537 pskb_expand_head+0x237/0x1050 net/core/skbuff.c:2185 netlink_trim+0x22d/0x310 net/netlink/af_netlink.c:1294 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1500 nlmsg_multicast_filtered include/net/netlink.h:1128 [inline] nlmsg_multicast include/net/netlink.h:1147 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2576 rtnl_notify net/core/rtnetlink.c:952 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4386 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4402 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4389 [inline] rtnetlink_event+0x177/0x1f0 net/core/rtnetlink.c:6972 notifier_call_chain+0xb7/0x410 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2206 page last free pid 5950 tgid 5950 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660 __put_partials+0x14c/0x170 mm/slub.c:3176 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4138 [inline] slab_alloc_node mm/slub.c:4187 [inline] __kmalloc_cache_noprof+0x243/0x410 mm/slub.c:4344 kmalloc_noprof include/linux/slab.h:902 [inline] kzalloc_noprof include/linux/slab.h:1036 [inline] ref_tracker_alloc+0x17c/0x5b0 lib/ref_tracker.c:203 __netdev_tracker_alloc include/linux/netdevice.h:4282 [inline] netdev_hold include/linux/netdevice.h:4311 [inline] netdev_hold include/linux/netdevice.h:4306 [inline] register_netdevice+0x166a/0x1eb0 net/core/dev.c:10968 veth_newlink+0x3c2/0x8f0 drivers/net/veth.c:1844 rtnl_newlink_create net/core/rtnetlink.c:3796 [inline] __rtnl_newlink net/core/rtnetlink.c:3907 [inline] rtnl_newlink+0xb95/0x1d60 net/core/rtnetlink.c:4022 rtnetlink_rcv_msg+0x95b/0xea0 net/core/rtnetlink.c:6912 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2533 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x8cb/0xd70 net/netlink/af_netlink.c:1882 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:733 [inline] __sys_sendto+0x488/0x4f0 net/socket.c:2187 __do_sys_sendto net/socket.c:2194 [inline] __se_sys_sendto net/socket.c:2190 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2190 Memory state around the buggy address: ffff888028544480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028544500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888028544580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028544600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028544680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================