Bluetooth: hci2: Opcode 0x0c1a failed: -4 Bluetooth: hci3: Opcode 0x0c1a failed: -4 Bluetooth: hci3: Opcode 0x0406 failed: -4 ================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x1b1/0x1d0 lib/list_debug.c:62 Read of size 8 at addr ffff8880215b8578 by task syz.0.226/7011 CPU: 1 UID: 0 PID: 7011 Comm: syz.0.226 Not tainted syzkaller #0 PREEMPT(full) 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:1643 l2cap_chan_del+0xbd/0x930 net/bluetooth/l2cap_core.c:656 l2cap_conn_del+0x395/0x710 net/bluetooth/l2cap_core.c:1802 l2cap_connect_cfm+0x9bb/0xf80 net/bluetooth/l2cap_core.c:7374 hci_connect_cfm include/net/bluetooth/hci_core.h:2139 [inline] hci_conn_failed+0x188/0x360 net/bluetooth/hci_conn.c:1409 hci_abort_conn_sync+0x7d9/0xb20 net/bluetooth/hci_sync.c:5763 hci_disconnect_all_sync.constprop.0.isra.0+0x155/0x430 net/bluetooth/hci_sync.c:5786 hci_suspend_sync+0x8b7/0xa70 net/bluetooth/hci_sync.c:6262 hci_suspend_dev+0x31d/0x540 net/bluetooth/hci_core.c:2850 hci_suspend_notifier+0x21e/0x330 net/bluetooth/hci_core.c:2421 notifier_call_chain+0x99/0x400 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+0xc8/0x160 kernel/notifier.c:333 pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:172 snapshot_open+0x189/0x2a0 kernel/power/user.c:77 misc_open+0x26d/0x450 drivers/char/misc.c:163 chrdev_open+0x234/0x6a0 fs/char_dev.c:411 do_dentry_open+0x6d8/0x1660 fs/open.c:947 vfs_open+0x82/0x3f0 fs/open.c:1079 do_open fs/namei.c:4699 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4858 do_file_open+0x20e/0x430 fs/namei.c:4887 do_sys_openat2+0x10d/0x1e0 fs/open.c:1364 do_sys_open fs/open.c:1370 [inline] __do_compat_sys_openat fs/open.c:1432 [inline] __se_compat_sys_openat fs/open.c:1430 [inline] __ia32_compat_sys_openat+0x12d/0x210 fs/open.c:1430 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x950 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf709efcc Code: d2 74 05 c1 e8 0c 89 02 8b 5d fc 31 c0 c9 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 58 b8 RSP: 002b:00000000f544b50c EFLAGS: 00000292 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 00000000800000c0 RDX: 0000000000080480 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 6963: 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_node_track_caller_noprof+0x304/0x850 mm/slub.c:5407 kmalloc_reserve+0xe8/0x350 net/core/skbuff.c:635 __alloc_skb+0x185/0x710 net/core/skbuff.c:713 alloc_skb include/linux/skbuff.h:1383 [inline] _sctp_make_chunk+0x51/0x270 net/sctp/sm_make_chunk.c:1435 sctp_make_data net/sctp/sm_make_chunk.c:1467 [inline] sctp_make_datafrag_empty+0x14e/0x230 net/sctp/sm_make_chunk.c:732 sctp_datamsg_from_user+0x5ea/0x1360 net/sctp/chunk.c:263 sctp_sendmsg_to_asoc+0xb1c/0x1c50 net/sctp/socket.c:1858 sctp_sendmsg+0x1185/0x22b0 net/sctp/socket.c:2030 inet_sendmsg+0x11c/0x140 net/ipv4/af_inet.c:866 sock_sendmsg_nosec net/socket.c:787 [inline] __sock_sendmsg net/socket.c:802 [inline] __sys_sendto+0x446/0x4b0 net/socket.c:2265 __do_sys_sendto net/socket.c:2272 [inline] __se_sys_sendto net/socket.c:2268 [inline] __ia32_sys_sendto+0xdd/0x1b0 net/socket.c:2268 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x950 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 6971: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2689 [inline] slab_free mm/slub.c:6250 [inline] kfree+0x223/0x6c0 mm/slub.c:6565 skb_kfree_head net/core/skbuff.c:1075 [inline] skb_free_head+0xb9/0x160 net/core/skbuff.c:1087 skb_release_data+0x6c5/0x8e0 net/core/skbuff.c:1114 skb_release_all net/core/skbuff.c:1189 [inline] __kfree_skb net/core/skbuff.c:1203 [inline] consume_skb net/core/skbuff.c:1436 [inline] consume_skb+0xc4/0x110 net/core/skbuff.c:1430 sctp_chunk_destroy net/sctp/sm_make_chunk.c:1495 [inline] sctp_chunk_put+0x1b2/0x2d0 net/sctp/sm_make_chunk.c:1522 sctp_datamsg_destroy net/sctp/chunk.c:111 [inline] sctp_datamsg_put+0x129/0x5f0 net/sctp/chunk.c:128 sctp_chunk_free+0x45/0x60 net/sctp/sm_make_chunk.c:1507 __sctp_outq_teardown+0x70a/0xc40 net/sctp/outqueue.c:257 sctp_association_free+0x210/0x7d0 net/sctp/associola.c:340 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:950 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1336 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1204 [inline] sctp_do_sm+0x1594/0x5be0 net/sctp/sm_sideeffect.c:1175 sctp_primitive_SHUTDOWN+0x9f/0xd0 net/sctp/primitive.c:89 sctp_shutdown+0x137/0x180 net/sctp/socket.c:5213 inet_shutdown+0x1a5/0x410 net/ipv4/af_inet.c:933 __sys_shutdown_sock net/socket.c:2538 [inline] __sys_shutdown_sock net/socket.c:2532 [inline] __sys_shutdown+0x116/0x1b0 net/socket.c:2554 __do_sys_shutdown net/socket.c:2559 [inline] __se_sys_shutdown net/socket.c:2557 [inline] __ia32_sys_shutdown+0x53/0x80 net/socket.c:2557 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x950 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff8880215b8000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1400 bytes inside of freed 2048-byte region [ffff8880215b8000, ffff8880215b8800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880215b8000 pfn:0x215b8 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 ffff88801b842f00 ffffea0000981010 ffffea0000039e10 raw: ffff8880215b8000 0000000800080006 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801b842f00 ffffea0000981010 ffffea0000039e10 head: ffff8880215b8000 0000000800080006 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 5750, tgid 5750 (syz-executor), ts 55722541636, free_ts 55554193629 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:7255 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] __kmalloc_cache_noprof+0x493/0x6f0 mm/slub.c:5414 kmalloc_noprof include/linux/slab.h:950 [inline] rtnl_newlink+0x126/0x2380 net/core/rtnetlink.c:4010 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6996 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2550 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 sock_sendmsg_nosec net/socket.c:787 [inline] __sock_sendmsg net/socket.c:802 [inline] __sys_sendto+0x468/0x4b0 net/socket.c:2265 __do_compat_sys_socketcall net/compat.c:475 [inline] __se_compat_sys_socketcall net/compat.c:423 [inline] __ia32_compat_sys_socketcall+0x59a/0x770 net/compat.c:423 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] do_int80_emulation+0x141/0x700 arch/x86/entry/syscall_32.c:172 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 page last free pid 5739 tgid 5739 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x747/0x1040 mm/page_alloc.c:2943 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4569 [inline] slab_alloc_node mm/slub.c:4898 [inline] kmem_cache_alloc_noprof+0x241/0x6e0 mm/slub.c:4905 alloc_empty_file+0x5b/0x1c0 fs/file_table.c:262 alloc_file fs/file_table.c:396 [inline] alloc_file_pseudo+0x13a/0x230 fs/file_table.c:425 sock_alloc_file+0x50/0x210 net/socket.c:543 sock_map_fd net/socket.c:573 [inline] __sys_socket+0x1c0/0x260 net/socket.c:1815 __do_compat_sys_socketcall net/compat.c:448 [inline] __se_compat_sys_socketcall net/compat.c:423 [inline] __ia32_compat_sys_socketcall+0x65b/0x770 net/compat.c:423 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x950 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff8880215b8400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880215b8480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880215b8500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880215b8580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880215b8600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: d2 74 05 c1 shlb %cl,-0x3f(%rbp,%rax,1) 4: e8 0c 89 02 8b call 0x8b028915 9: 5d pop %rbp a: fc cld b: 31 c0 xor %eax,%eax d: c9 leave e: c3 ret f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 0f 1f 00 nopl (%rax) 21: 51 push %rcx 22: 52 push %rdx 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 ret 2e: 90 nop 2f: 2e 8d b4 26 00 00 00 cs lea 0x0(%rsi,%riz,1),%esi 36: 00 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 3e: 58 pop %rax 3f: b8 .byte 0xb8