================================================================== BUG: KASAN: slab-use-after-free in hci_send_acl+0x48/0xe70 net/bluetooth/hci_core.c:3231 Read of size 8 at addr ffff8880568be818 by task kworker/0:3/5037 CPU: 0 PID: 5037 Comm: kworker/0:3 Not tainted 6.6.0-syzkaller-00207-g14ab6d425e80 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Workqueue: events l2cap_info_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 hci_send_acl+0x48/0xe70 net/bluetooth/hci_core.c:3231 l2cap_send_conn_req net/bluetooth/l2cap_core.c:1286 [inline] l2cap_start_connection+0x465/0x620 net/bluetooth/l2cap_core.c:1514 l2cap_conn_start+0xbf3/0x1130 net/bluetooth/l2cap_core.c:1661 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 2462: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] hci_chan_create+0xc8/0x300 net/bluetooth/hci_conn.c:2723 l2cap_conn_add+0x69/0xc10 net/bluetooth/l2cap_core.c:7841 l2cap_chan_connect+0x61f/0xeb0 net/bluetooth/l2cap_core.c:8053 bt_6lowpan_connect net/bluetooth/6lowpan.c:894 [inline] lowpan_control_write+0x55e/0x850 net/bluetooth/6lowpan.c:1129 full_proxy_write+0x113/0x1c0 fs/debugfs/file.c:236 vfs_write+0x290/0xb20 fs/read_write.c:582 ksys_write+0x1a0/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 50: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x25f/0x3b0 mm/slub.c:3822 hci_chan_list_flush net/bluetooth/hci_conn.c:2763 [inline] hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline] hci_conn_del+0x4f8/0xc40 net/bluetooth/hci_conn.c:1156 hci_abort_conn_sync+0x73c/0xfb0 net/bluetooth/hci_sync.c:5428 hci_cmd_sync_work+0x228/0x400 net/bluetooth/hci_sync.c:306 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/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+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 kvfree_call_rcu+0xf8/0x790 kernel/rcu/tree.c:3372 kernfs_unlink_open_file+0x42d/0x510 fs/kernfs/file.c:633 kernfs_fop_release+0x128/0x190 fs/kernfs/file.c:805 __fput+0x3cc/0xa10 fs/file_table.c:394 __do_sys_close fs/open.c:1590 [inline] __se_sys_close+0x15f/0x220 fs/open.c:1575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 kvfree_call_rcu+0xf8/0x790 kernel/rcu/tree.c:3372 kernfs_unlink_open_file+0x42d/0x510 fs/kernfs/file.c:633 kernfs_fop_release+0x128/0x190 fs/kernfs/file.c:805 __fput+0x3cc/0xa10 fs/file_table.c:394 __do_sys_close fs/open.c:1590 [inline] __se_sys_close+0x15f/0x220 fs/open.c:1575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880568be800 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of freed 128-byte region [ffff8880568be800, ffff8880568be880) The buggy address belongs to the physical page: page:ffffea00015a2f80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880568be500 pfn:0x568be flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff8880128418c0 ffffea0001cddc50 ffffea00009df850 raw: ffff8880568be500 0000000000100003 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5035, tgid 5035 (syz-executor.1), ts 70456135473, free_ts 70431276377 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 __alloc_pages_node include/linux/gfp.h:237 [inline] alloc_slab_page+0x59/0x160 mm/slub.c:1872 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1025 [inline] __kmalloc_node+0xa7/0x230 mm/slab_common.c:1033 kmalloc_array_node include/linux/slab.h:697 [inline] kcalloc_node include/linux/slab.h:702 [inline] memcg_alloc_slab_cgroups+0x81/0x120 mm/memcontrol.c:2895 account_slab mm/slab.h:636 [inline] allocate_slab mm/slub.c:2035 [inline] new_slab+0xc0/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x1bf/0x300 mm/slub.c:3502 vm_area_dup+0x27/0x280 kernel/fork.c:500 dup_mmap kernel/fork.c:710 [inline] dup_mm kernel/fork.c:1684 [inline] copy_mm+0xcea/0x1f10 kernel/fork.c:1733 copy_process+0x1d73/0x41a0 kernel/fork.c:2499 kernel_clone+0x222/0x840 kernel/fork.c:2907 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+0x8c3/0x9f0 mm/page_alloc.c:2312 free_unref_page_list+0x596/0x830 mm/page_alloc.c:2451 release_pages+0x2113/0x23f0 mm/swap.c:1042 tlb_batch_pages_flush mm/mmu_gather.c:98 [inline] tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu+0x34c/0x4e0 mm/mmu_gather.c:300 tlb_finish_mmu+0xd4/0x1f0 mm/mmu_gather.c:392 exit_mmap+0x4d3/0xc50 mm/mmap.c:3243 __mmput+0x115/0x3c0 kernel/fork.c:1349 exit_mm+0x21f/0x300 kernel/exit.c:567 do_exit+0x9af/0x2650 kernel/exit.c:861 do_group_exit+0x206/0x2c0 kernel/exit.c:1024 get_signal+0x175d/0x1840 kernel/signal.c:2892 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff8880568be700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880568be780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880568be800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880568be880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880568be900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================