Bluetooth: hci0: Opcode 0x0406 failed: -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 ffff8880681e6550 by task syz.1.291/7137 CPU: 1 UID: 0 PID: 7137 Comm: syz.1.291 Not tainted 6.13.0-syzkaller-08291-g805ba04cb7cc #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 __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:1601 l2cap_chan_del+0xba/0x8f0 net/bluetooth/l2cap_core.c:658 l2cap_conn_del+0x37c/0x730 net/bluetooth/l2cap_core.c:1785 l2cap_connect_cfm+0x7aa/0xf10 net/bluetooth/l2cap_core.c:7235 hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline] hci_conn_failed+0x225/0x3e0 net/bluetooth/hci_conn.c:1266 hci_abort_conn_sync+0x968/0x1030 net/bluetooth/hci_sync.c:5588 hci_disconnect_all_sync.constprop.0+0x104/0x3c0 net/bluetooth/hci_sync.c:5611 hci_suspend_sync+0x772/0xab0 net/bluetooth/hci_sync.c:6088 hci_suspend_dev+0x27d/0x5e0 net/bluetooth/hci_core.c:2811 hci_suspend_notifier+0x28d/0x2f0 net/bluetooth/hci_core.c:2391 notifier_call_chain+0xb7/0x410 kernel/notifier.c:85 notifier_call_chain_robust kernel/notifier.c:120 [inline] blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline] blocking_notifier_call_chain_robust+0xc9/0x170 kernel/notifier.c:333 pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102 snapshot_open+0x189/0x2b0 kernel/power/user.c:77 misc_open+0x35a/0x420 drivers/char/misc.c:165 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0x735/0x1c40 fs/open.c:955 vfs_open+0x82/0x3f0 fs/open.c:1085 do_open fs/namei.c:3828 [inline] path_openat+0x1e88/0x2d80 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1427 do_sys_open fs/open.c:1442 [inline] __do_compat_sys_openat fs/open.c:1504 [inline] __se_compat_sys_openat fs/open.c:1502 [inline] __ia32_compat_sys_openat+0x16e/0x210 fs/open.c:1502 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 RIP: 0023:0xf7fb4579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f50b555c EFLAGS: 00000296 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 00000000200002c0 RDX: 0000000000040000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 7117: 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 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_noprof+0x21a/0x4f0 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2181 sk_alloc+0x36/0xb90 net/core/sock.c:2234 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 l2cap_sock_alloc.constprop.0+0x33/0x1d0 net/bluetooth/l2cap_sock.c:1879 l2cap_sock_create+0x123/0x1f0 net/bluetooth/l2cap_sock.c:1921 bt_sock_create+0x182/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x335/0x8d0 net/socket.c:1543 sock_create net/socket.c:1601 [inline] __sys_socket_create net/socket.c:1638 [inline] __sys_socket+0x14f/0x260 net/socket.c:1685 __do_sys_socket net/socket.c:1699 [inline] __se_sys_socket net/socket.c:1697 [inline] __ia32_sys_socket+0x72/0xb0 net/socket.c:1697 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 7116: 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:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 sk_prot_free net/core/sock.c:2217 [inline] __sk_destruct+0x5eb/0x720 net/core/sock.c:2309 sk_destruct+0xc2/0xf0 net/core/sock.c:2324 __sk_free+0xf4/0x3e0 net/core/sock.c:2335 sk_free+0x6a/0x90 net/core/sock.c:2346 sock_put include/net/sock.h:1913 [inline] l2cap_sock_kill net/bluetooth/l2cap_sock.c:1252 [inline] l2cap_sock_kill+0x171/0x2d0 net/bluetooth/l2cap_sock.c:1237 l2cap_sock_release+0x189/0x210 net/bluetooth/l2cap_sock.c:1423 __sock_release+0xb0/0x270 net/socket.c:642 sock_close+0x1c/0x30 net/socket.c:1393 __fput+0x3ff/0xb70 fs/file_table.c:450 task_work_run+0x14e/0x250 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 __do_fast_syscall_32+0x80/0x120 arch/x86/entry/common.c:389 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 ffff8880681e6000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1360 bytes inside of freed 2048-byte region [ffff8880681e6000, ffff8880681e6800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x681e0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b042f00 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b042f00 0000000000000000 dead000000000001 head: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 head: 04fff00000000003 ffffea0001a07801 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5944, tgid 5944 (syz-executor), ts 45648482873, free_ts 0 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:4739 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x23d/0x330 mm/slub.c:2640 ___slab_alloc+0xbfa/0x1600 mm/slub.c:3826 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_node_track_caller_noprof+0x2ee/0x520 mm/slub.c:4313 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609 pskb_expand_head+0x236/0x1170 net/core/skbuff.c:2275 netlink_trim+0x22d/0x310 net/netlink/af_netlink.c:1304 netlink_broadcast_filtered+0xc7/0xef0 net/netlink/af_netlink.c:1510 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:2586 rtnl_notify net/core/rtnetlink.c:952 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4385 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4401 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4388 [inline] rtmsg_ifinfo+0x174/0x1a0 net/core/rtnetlink.c:4407 __dev_notify_flags+0x24e/0x2e0 net/core/dev.c:9207 rtnl_configure_link+0x1b7/0x260 net/core/rtnetlink.c:3561 page_owner free stack trace missing Memory state around the buggy address: ffff8880681e6400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880681e6480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880681e6500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880681e6580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880681e6600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi