================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:116 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: use-after-free in sock_hold include/net/sock.h:777 [inline] BUG: KASAN: use-after-free in sco_conn_del+0xb9/0x2b0 net/bluetooth/sco.c:193 Write of size 4 at addr ffff88807c402080 by task syz-executor.1/19676 CPU: 0 PID: 19676 Comm: syz-executor.1 Not tainted 6.4.0-rc7-syzkaller-00041-ge660abd551f1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:187 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:116 [inline] __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] sock_hold include/net/sock.h:777 [inline] sco_conn_del+0xb9/0x2b0 net/bluetooth/sco.c:193 sco_disconn_cfm+0x75/0xb0 net/bluetooth/sco.c:1392 hci_disconn_cfm include/net/bluetooth/hci_core.h:1836 [inline] hci_conn_hash_flush+0x114/0x230 net/bluetooth/hci_conn.c:2488 hci_dev_close_sync+0x5fb/0x1200 net/bluetooth/hci_sync.c:4952 hci_dev_do_close+0x31/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x1e7/0x590 net/bluetooth/hci_core.c:2705 vhci_release+0x80/0xf0 drivers/bluetooth/hci_vhci.c:669 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xaa3/0x29b0 kernel/exit.c:874 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x2318/0x25b0 kernel/signal.c:2876 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f8adf0b10b1 Code: Unable to access opcode bytes at 0x7f8adf0b1087. RSP: 002b:00007f8adfdeb0b0 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: fffffffffffffdfc RBX: 00007f8adf1abf80 RCX: 00007f8adf0b10b1 RDX: 00007f8adfdeb0f0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f8adf0d7493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007ffee871be3f R14: 00007f8adfdeb300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea0001f10080 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x7c402 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffff7f(buddy) raw: 00fff00000000000 ffffea0000cda3c8 ffffea0001e178c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT), pid 23064, tgid 23064 (syz-executor.5), ts 3493672381374, free_ts 3495452238197 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x1a/0x230 arch/x86/mm/pgtable.c:33 __pte_alloc+0x6d/0x260 mm/memory.c:439 copy_pte_range mm/memory.c:1015 [inline] copy_pmd_range mm/memory.c:1150 [inline] copy_pud_range mm/memory.c:1187 [inline] copy_p4d_range mm/memory.c:1211 [inline] copy_page_range+0x151e/0x3830 mm/memory.c:1309 dup_mmap+0x10bc/0x19d0 kernel/fork.c:761 dup_mm kernel/fork.c:1692 [inline] copy_mm kernel/fork.c:1741 [inline] copy_process+0x6663/0x75c0 kernel/fork.c:2507 kernel_clone+0xeb/0x890 kernel/fork.c:2915 __do_sys_clone+0xba/0x100 kernel/fork.c:3058 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564 free_unref_page_list+0xe3/0xa70 mm/page_alloc.c:2705 release_pages+0xcd8/0x1380 mm/swap.c:1042 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391 exit_mmap+0x2b2/0x930 mm/mmap.c:3120 __mmput+0x128/0x4c0 kernel/fork.c:1351 mmput+0x60/0x70 kernel/fork.c:1373 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b0/0x29b0 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x2318/0x25b0 kernel/signal.c:2876 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88807c401f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807c402000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807c402080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807c402100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807c402180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================