================================================================== BUG: KASAN: slab-use-after-free in hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228 Read of size 8 at addr ffff88801dc70918 by task kworker/0:2/54 CPU: 0 PID: 54 Comm: kworker/0:2 Not tainted 6.6.0-rc2-syzkaller-00743-g35766690d675 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Workqueue: events l2cap_info_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228 l2cap_send_cmd+0x6dd/0x920 net/bluetooth/l2cap_core.c:977 l2cap_send_conn_req+0x1e5/0x260 net/bluetooth/l2cap_core.c:1286 l2cap_start_connection+0x11e/0x420 net/bluetooth/l2cap_core.c:1514 l2cap_conn_start+0x7ae/0xa40 net/bluetooth/l2cap_core.c:1661 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 5051: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] hci_chan_create+0xa6/0x3a0 net/bluetooth/hci_conn.c:2707 l2cap_conn_add.part.0+0x1a/0xdf0 net/bluetooth/l2cap_core.c:7841 l2cap_conn_add include/net/bluetooth/l2cap.h:866 [inline] l2cap_chan_connect+0x15b9/0x2140 net/bluetooth/l2cap_core.c:8053 l2cap_sock_connect+0x33f/0x720 net/bluetooth/l2cap_sock.c:256 kernel_connect+0x103/0x170 net/socket.c:3577 rfcomm_session_create net/bluetooth/rfcomm/core.c:811 [inline] __rfcomm_dlc_open net/bluetooth/rfcomm/core.c:388 [inline] rfcomm_dlc_open+0x81f/0xaa0 net/bluetooth/rfcomm/core.c:431 rfcomm_sock_connect+0x430/0x640 net/bluetooth/rfcomm/sock.c:409 __sys_connect_file+0x15b/0x1a0 net/socket.c:2033 __sys_connect+0x145/0x170 net/socket.c:2050 __do_sys_connect net/socket.c:2060 [inline] __se_sys_connect net/socket.c:2057 [inline] __x64_sys_connect+0x72/0xb0 net/socket.c:2057 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 4446: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 hci_chan_list_flush+0x81/0xf0 net/bluetooth/hci_conn.c:2747 hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline] hci_conn_del+0x201/0xd10 net/bluetooth/hci_conn.c:1156 hci_abort_conn_sync+0xabf/0xe10 net/bluetooth/hci_sync.c:5435 abort_conn_sync+0x187/0x390 net/bluetooth/hci_conn.c:2894 hci_cmd_sync_work+0x1a4/0x3c0 net/bluetooth/hci_sync.c:306 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3372 kernfs_unlink_open_file+0x3b6/0x4b0 fs/kernfs/file.c:633 kernfs_fop_release+0xec/0x1e0 fs/kernfs/file.c:805 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3372 kernfs_unlink_open_file+0x3b6/0x4b0 fs/kernfs/file.c:633 kernfs_fop_release+0xec/0x1e0 fs/kernfs/file.c:805 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88801dc70900 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of freed 128-byte region [ffff88801dc70900, ffff88801dc70980) The buggy address belongs to the physical page: page:ffffea0000771c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1dc70 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888012c418c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 11, tgid 11 (kworker/u4:0), ts 15018445340, free_ts 15016928956 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 __alloc_pages_node include/linux/gfp.h:237 [inline] alloc_slab_page mm/slub.c:1872 [inline] allocate_slab+0xa1/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x340 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc_node+0x52/0x110 mm/slab_common.c:1030 kmalloc_node include/linux/slab.h:619 [inline] kvmalloc_node+0x99/0x1a0 mm/util.c:607 kvzalloc_node include/linux/slab.h:741 [inline] sbitmap_init_node+0x1c8/0x680 lib/sbitmap.c:113 blk_mq_alloc_hctx block/blk-mq.c:3721 [inline] blk_mq_alloc_and_init_hctx+0xa74/0x1190 block/blk-mq.c:4169 blk_mq_realloc_hw_ctxs+0x4ba/0x630 block/blk-mq.c:4202 blk_mq_init_allocated_queue+0x39d/0x1360 block/blk-mq.c:4255 blk_mq_init_queue_data block/blk-mq.c:4074 [inline] blk_mq_init_queue+0x85/0xe0 block/blk-mq.c:4084 scsi_alloc_sdev+0x80a/0xd10 drivers/scsi/scsi_scan.c:335 scsi_probe_and_add_lun+0x170d/0x27d0 drivers/scsi/scsi_scan.c:1189 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 mm_free_pgd kernel/fork.c:803 [inline] __mmdrop+0xd7/0x470 kernel/fork.c:919 mmdrop include/linux/sched/mm.h:54 [inline] __mmput+0x409/0x4d0 kernel/fork.c:1360 mmput+0x62/0x70 kernel/fork.c:1371 free_bprm+0x144/0x3f0 fs/exec.c:1492 kernel_execve+0x3e7/0x4e0 fs/exec.c:2026 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff88801dc70800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801dc70880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801dc70900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801dc70980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801dc70a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================