Bluetooth: hci4: Error when powering off device on rfkill (-4) Bluetooth: hci2: Opcode 0x0c1a failed: -4 Bluetooth: hci2: Error when powering off device on rfkill (-4) ================================================================== BUG: KASAN: slab-out-of-bounds in __list_del_entry_valid_or_report+0x1b1/0x1d0 lib/list_debug.c:62 Read of size 8 at addr ffff8880580a9578 by task syz.3.2710/15801 CPU: 3 UID: 0 PID: 15801 Comm: syz.3.2710 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1d0 mm/kasan/report.c:595 __list_del_entry_valid_or_report+0x1b1/0x1d0 lib/list_debug.c:62 __list_del_entry_valid include/linux/list.h:132 [inline] __list_del_entry include/linux/list.h:223 [inline] list_del_init include/linux/list.h:295 [inline] bt_accept_unlink+0x34/0x2f0 net/bluetooth/af_bluetooth.c:259 l2cap_sock_teardown_cb+0x1a3/0x3f0 net/bluetooth/l2cap_sock.c:1640 l2cap_chan_del+0xbd/0x930 net/bluetooth/l2cap_core.c:656 l2cap_conn_del+0x395/0x710 net/bluetooth/l2cap_core.c:1802 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7448 [inline] l2cap_disconn_cfm+0x9f/0x100 net/bluetooth/l2cap_core.c:7441 hci_disconn_cfm include/net/bluetooth/hci_core.h:2154 [inline] hci_conn_hash_flush+0x10e/0x280 net/bluetooth/hci_conn.c:2650 hci_dev_close_sync+0x5a7/0x1240 net/bluetooth/hci_sync.c:5368 hci_dev_do_close+0x2e/0xb0 net/bluetooth/hci_core.c:502 hci_rfkill_set_block+0x225/0x3a0 net/bluetooth/hci_core.c:930 rfkill_set_block+0x205/0x510 net/rfkill/core.c:360 rfkill_fop_write+0x2c0/0x580 net/rfkill/core.c:1314 vfs_write+0x2aa/0x1070 fs/read_write.c:686 ksys_write+0x1f8/0x250 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc552b9cdd9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc553a8d028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fc552e16090 RCX: 00007fc552b9cdd9 RDX: 0000000000000008 RSI: 0000200000000080 RDI: 000000000000000b RBP: 00007fc552c32d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fc552e16128 R14: 00007fc552e16090 R15: 00007fff52125cd8 Allocated by task 15373: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5295 [inline] __kmalloc_noprof+0x301/0x850 mm/slub.c:5307 kmalloc_noprof include/linux/slab.h:954 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] ops_init+0x77/0x5f0 net/core/net_namespace.c:127 setup_net+0x118/0x3a0 net/core/net_namespace.c:446 copy_net_ns+0x46f/0x7c0 net/core/net_namespace.c:579 create_new_namespaces+0x3ea/0xac0 kernel/nsproxy.c:132 unshare_nsproxy_namespaces+0xf2/0x220 kernel/nsproxy.c:234 ksys_unshare+0x438/0xab0 kernel/fork.c:3245 __do_sys_unshare kernel/fork.c:3319 [inline] __se_sys_unshare kernel/fork.c:3317 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3317 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880580a9000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 344 bytes to the right of allocated 1056-byte region [ffff8880580a9000, ffff8880580a9420) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x580a8 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 ffff88801b842f00 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800080008 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842f00 dead000000000100 dead000000000122 head: 0000000000000000 0000000800080008 00000000f5000000 0000000000000000 head: 00fff00000000003 fffffffffffffe01 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 5730, tgid 5730 (syz-executor), ts 54302515988, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858 prep_new_page mm/page_alloc.c:1866 [inline] get_page_from_freelist+0x11a6/0x33b0 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x27c/0x2bc0 mm/page_alloc.c:5226 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab mm/slub.c:3467 [inline] new_slab+0xa6/0x6c0 mm/slub.c:3525 refill_objects+0x277/0x420 mm/slub.c:7251 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x375/0x650 mm/slub.c:4651 alloc_from_pcs mm/slub.c:4749 [inline] slab_alloc_node mm/slub.c:4883 [inline] __do_kmalloc_node mm/slub.c:5294 [inline] __kmalloc_noprof+0x688/0x850 mm/slub.c:5307 kmalloc_noprof include/linux/slab.h:954 [inline] genl_family_rcv_msg_attrs_parse.isra.0+0x100/0x2f0 net/netlink/genetlink.c:936 genl_start+0x18f/0x970 net/netlink/genetlink.c:979 __netlink_dump_start+0x60e/0x990 net/netlink/af_netlink.c:2431 genl_family_rcv_msg_dumpit+0x1e2/0x2e0 net/netlink/genetlink.c:1075 genl_family_rcv_msg net/netlink/genetlink.c:1191 [inline] genl_rcv_msg+0x471/0x800 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2550 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1894 page_owner free stack trace missing Memory state around the buggy address: ffff8880580a9400: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ffff8880580a9480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880580a9500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880580a9580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880580a9600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================