Bluetooth: hci3: Error when powering off device on rfkill (-4) Bluetooth: hci4: Opcode 0x0c1a failed: -4 Bluetooth: hci4: Error when powering off device on rfkill (-4) ================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x1d4/0x200 lib/list_debug.c:62 Read of size 8 at addr ffff888079ecd558 by task syz.1.227/6964 CPU: 0 UID: 0 PID: 6964 Comm: syz.1.227 Not tainted 6.15.0-rc7-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __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+0xe0/0x110 mm/kasan/report.c:634 __list_del_entry_valid_or_report+0x1d4/0x200 lib/list_debug.c:62 __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del_init include/linux/list.h:287 [inline] bt_accept_unlink+0x34/0x2e0 net/bluetooth/af_bluetooth.c:256 l2cap_sock_teardown_cb+0x1a3/0x3c0 net/bluetooth/l2cap_sock.c:1613 l2cap_chan_del+0xba/0x8f0 net/bluetooth/l2cap_core.c:655 l2cap_conn_del+0x37a/0x730 net/bluetooth/l2cap_core.c:1786 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7300 [inline] l2cap_disconn_cfm+0x96/0xd0 net/bluetooth/l2cap_core.c:7293 hci_disconn_cfm include/net/bluetooth/hci_core.h:2068 [inline] hci_conn_hash_flush+0x10e/0x260 net/bluetooth/hci_conn.c:2534 hci_dev_close_sync+0x602/0x11d0 net/bluetooth/hci_sync.c:5225 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+0x1fe/0x550 net/rfkill/core.c:346 rfkill_fop_write+0x2c0/0x580 net/rfkill/core.c:1301 vfs_write+0x25c/0x1180 fs/read_write.c:682 ksys_write+0x205/0x240 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f62f618e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f62f700b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f62f63b6080 RCX: 00007f62f618e969 RDX: 0000000000000008 RSI: 0000200000000300 RDI: 0000000000000005 RBP: 00007f62f6210ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f62f63b6080 R15: 00007fff434aa108 Allocated by task 5832: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1cb/0x3b0 mm/slub.c:4203 getname_flags.part.0+0x4c/0x550 fs/namei.c:146 getname_flags+0x93/0xf0 include/linux/audit.h:322 getname include/linux/fs.h:2852 [inline] getname_maybe_null include/linux/fs.h:2859 [inline] getname_maybe_null include/linux/fs.h:2856 [inline] vfs_fstatat+0xe1/0xf0 fs/stat.c:367 __do_sys_newfstatat+0xa1/0x130 fs/stat.c:536 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5832: 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:2380 [inline] slab_free mm/slub.c:4642 [inline] kmem_cache_free+0x2d4/0x4d0 mm/slub.c:4744 putname+0x154/0x1a0 fs/namei.c:297 vfs_fstatat+0x85/0xf0 fs/stat.c:373 __do_sys_newfstatat+0xa1/0x130 fs/stat.c:536 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888079ecd500 which belongs to the cache names_cache of size 4096 The buggy address is located 88 bytes inside of freed 4096-byte region [ffff888079ecd500, ffff888079ece500) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79ec8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88814042f140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000070007 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88814042f140 dead000000000122 0000000000000000 head: 0000000000000000 0000000000070007 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001e7b201 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5832, tgid 5832 (udevd), ts 168674502503, free_ts 168667907448 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1714 prep_new_page mm/page_alloc.c:1722 [inline] get_page_from_freelist+0x135c/0x3920 mm/page_alloc.c:3684 __alloc_frozen_pages_noprof+0x263/0x23a0 mm/page_alloc.c:4966 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab mm/slub.c:2618 [inline] new_slab+0x244/0x340 mm/slub.c:2672 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3858 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3948 __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] kmem_cache_alloc_noprof+0xef/0x3b0 mm/slub.c:4203 getname_flags.part.0+0x4c/0x550 fs/namei.c:146 getname_flags+0x93/0xf0 include/linux/audit.h:322 getname include/linux/fs.h:2852 [inline] getname_maybe_null include/linux/fs.h:2859 [inline] getname_maybe_null include/linux/fs.h:2856 [inline] vfs_fstatat+0xe1/0xf0 fs/stat.c:367 __do_sys_newfstatat+0xa1/0x130 fs/stat.c:536 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5800 tgid 5800 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1258 [inline] __free_frozen_pages+0x69d/0xff0 mm/page_alloc.c:2721 __folio_put+0x329/0x450 mm/swap.c:112 folio_put include/linux/mm.h:1580 [inline] put_page include/linux/mm.h:1649 [inline] skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_frag_unref include/linux/skbuff_ref.h:71 [inline] __pskb_trim_head+0x6e5/0xa70 net/ipv4/tcp_output.c:1719 tcp_trim_head+0x85/0x5f0 net/ipv4/tcp_output.c:1746 tcp_tso_acked net/ipv4/tcp_input.c:3316 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3382 [inline] tcp_ack+0x1c34/0x5c90 net/ipv4/tcp_input.c:4054 tcp_rcv_established+0x536/0x2180 net/ipv4/tcp_input.c:6301 tcp_v4_do_rcv+0x5ca/0xa90 net/ipv4/tcp_ipv4.c:1925 tcp_v4_rcv+0x3601/0x4640 net/ipv4/tcp_ipv4.c:2363 ip_protocol_deliver_rcu+0xba/0x4c0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x316/0x570 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip_local_deliver+0x18e/0x1f0 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:469 [inline] ip_sublist_rcv_finish+0x2c1/0x620 net/ipv4/ip_input.c:578 ip_list_rcv_finish+0x552/0x720 net/ipv4/ip_input.c:627 ip_sublist_rcv net/ipv4/ip_input.c:635 [inline] ip_list_rcv+0x335/0x450 net/ipv4/ip_input.c:669 __netif_receive_skb_list_ptype net/core/dev.c:5930 [inline] __netif_receive_skb_list_core+0x752/0x950 net/core/dev.c:5977 __netif_receive_skb_list net/core/dev.c:6029 [inline] netif_receive_skb_list_internal+0x752/0xdb0 net/core/dev.c:6120 Memory state around the buggy address: ffff888079ecd400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079ecd480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888079ecd500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888079ecd580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888079ecd600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================