================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff888020814120 by task syz-executor.0/9939 CPU: 0 PID: 9939 Comm: syz-executor.0 Not tainted 5.15.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x2d6 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 lock_sock_nested+0x2f/0xf0 net/core/sock.c:3203 l2cap_sock_teardown_cb+0xa1/0x660 net/bluetooth/l2cap_sock.c:1528 l2cap_chan_del+0xbc/0xa80 net/bluetooth/l2cap_core.c:622 l2cap_conn_del+0x3c0/0x7b0 net/bluetooth/l2cap_core.c:1898 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8177 [inline] l2cap_disconn_cfm+0x95/0xd0 net/bluetooth/l2cap_core.c:8170 hci_disconn_cfm include/net/bluetooth/hci_core.h:1518 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x57d/0x1130 net/bluetooth/hci_core.c:1793 hci_unregister_dev+0x1c0/0x5a0 net/bluetooth/hci_core.c:4029 vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:340 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xbae/0x2a30 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f0ec2891a39 Code: Unable to access opcode bytes at RIP 0x7f0ec2891a0f. RSP: 002b:00007fff73ff3ba8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000001350 RCX: 00007f0ec2891a39 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 0000000000000000 R08: 0000000000000014 R09: 0000000000001350 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0ec28ebfda R13: 0000000000000000 R14: 0000000000000004 R15: 00007fff73ff3d90 Allocated by task 16146: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa1/0xd0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __do_kmalloc mm/slab.c:3702 [inline] __kmalloc+0x214/0x4d0 mm/slab.c:3711 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1839 sk_alloc+0x30/0xa60 net/core/sock.c:1892 l2cap_sock_alloc.constprop.0+0x31/0x230 net/bluetooth/l2cap_sock.c:1813 l2cap_sock_create+0x123/0x1f0 net/bluetooth/l2cap_sock.c:1859 bt_sock_create+0x17c/0x340 net/bluetooth/af_bluetooth.c:130 __sock_create+0x353/0x790 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0xef/0x200 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 16145: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xd1/0x110 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] __cache_free mm/slab.c:3445 [inline] kfree+0x10a/0x2c0 mm/slab.c:3803 sk_prot_free net/core/sock.c:1875 [inline] __sk_destruct+0x6a8/0x900 net/core/sock.c:1961 sk_destruct+0xbd/0xe0 net/core/sock.c:1976 __sk_free+0xef/0x3d0 net/core/sock.c:1987 sk_free+0x78/0xa0 net/core/sock.c:1998 sock_put include/net/sock.h:1848 [inline] l2cap_sock_kill+0x203/0x240 net/bluetooth/l2cap_sock.c:1227 l2cap_sock_release+0x184/0x200 net/bluetooth/l2cap_sock.c:1397 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888020814000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 288 bytes inside of 2048-byte region [ffff888020814000, ffff888020814800) The buggy address belongs to the page: page:ffffea0000820500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20814 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001b75248 ffffea0001ba2788 ffff888010c40800 raw: 0000000000000000 ffff888020814000 0000000100000001 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 0x242220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 16146, ts 1676039477399, free_ts 1676023684758 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4153 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375 __alloc_pages_node include/linux/gfp.h:570 [inline] kmem_getpages mm/slab.c:1377 [inline] cache_grow_begin+0x75/0x460 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] __do_cache_alloc mm/slab.c:3275 [inline] slab_alloc mm/slab.c:3316 [inline] __do_kmalloc mm/slab.c:3700 [inline] __kmalloc+0x3d5/0x4d0 mm/slab.c:3711 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1839 sk_alloc+0x30/0xa60 net/core/sock.c:1892 l2cap_sock_alloc.constprop.0+0x31/0x230 net/bluetooth/l2cap_sock.c:1813 l2cap_sock_create+0x123/0x1f0 net/bluetooth/l2cap_sock.c:1859 bt_sock_create+0x17c/0x340 net/bluetooth/af_bluetooth.c:130 __sock_create+0x353/0x790 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0xef/0x200 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3431 release_pages+0x830/0x20b0 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu mm/mmu_gather.c:249 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:340 exit_mmap+0x1ea/0x630 mm/mmap.c:3173 __mmput+0x122/0x4b0 kernel/fork.c:1115 mmput+0x58/0x60 kernel/fork.c:1136 exit_mm kernel/exit.c:501 [inline] do_exit+0xabc/0x2a30 kernel/exit.c:812 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x47f/0x21d0 kernel/signal.c:2855 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888020814000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020814080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020814100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020814180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020814200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================