================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [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:702 [inline] BUG: KASAN: use-after-free in sco_conn_del+0xb5/0x2f0 net/bluetooth/sco.c:193 Write of size 4 at addr ffff8880211e7080 by task syz-executor.5/28670 CPU: 1 PID: 28670 Comm: syz-executor.5 Not tainted 5.15.0-rc3-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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x66/0x3e0 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:459 kasan_check_range+0x2b5/0x2f0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [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:702 [inline] sco_conn_del+0xb5/0x2f0 net/bluetooth/sco.c:193 hci_disconn_cfm include/net/bluetooth/hci_core.h:1518 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x93e/0xeb0 net/bluetooth/hci_core.c:1793 hci_unregister_dev+0x2a2/0x510 net/bluetooth/hci_core.c:4029 vhci_release+0x73/0xc0 drivers/bluetooth/hci_vhci.c:340 __fput+0x3fe/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x6fc/0x2580 kernel/exit.c:825 do_group_exit+0x168/0x2d0 kernel/exit.c:922 get_signal+0x16e0/0x20c0 kernel/signal.c:2868 arch_do_signal_or_restart+0x9c/0x730 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+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f1212a62709 Code: Unable to access opcode bytes at RIP 0x7f1212a626df. RSP: 002b:00007f120ffd9218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f1212b66f68 RCX: 00007f1212a62709 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f1212b66f68 RBP: 00007f1212b66f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1212b66f6c R13: 00007ffc379df42f R14: 00007f120ffd9300 R15: 0000000000022000 Allocated by task 30011: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x24d/0x370 mm/slub.c:4391 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xf4/0x230 net/core/sock.c:1822 sk_alloc+0x35/0x300 net/core/sock.c:1875 sco_sock_alloc net/bluetooth/sco.c:491 [inline] sco_sock_create+0xb0/0x2f0 net/bluetooth/sco.c:526 bt_sock_create+0x15b/0x220 net/bluetooth/af_bluetooth.c:130 __sock_create+0x580/0x8d0 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0x133/0x380 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 28670: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook+0x129/0x1a0 mm/slub.c:1725 slab_free mm/slub.c:3483 [inline] kfree+0xcf/0x2f0 mm/slub.c:4543 sk_prot_free net/core/sock.c:1858 [inline] __sk_destruct+0x575/0x820 net/core/sock.c:1943 sock_put include/net/sock.h:1816 [inline] sco_conn_del+0x190/0x2f0 net/bluetooth/sco.c:198 hci_disconn_cfm include/net/bluetooth/hci_core.h:1518 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x93e/0xeb0 net/bluetooth/hci_core.c:1793 hci_unregister_dev+0x2a2/0x510 net/bluetooth/hci_core.c:4029 vhci_release+0x73/0xc0 drivers/bluetooth/hci_vhci.c:340 __fput+0x3fe/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x6fc/0x2580 kernel/exit.c:825 do_group_exit+0x168/0x2d0 kernel/exit.c:922 get_signal+0x16e0/0x20c0 kernel/signal.c:2868 arch_do_signal_or_restart+0x9c/0x730 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+0x191/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880211e7000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff8880211e7000, ffff8880211e7800) The buggy address belongs to the page: page:ffffea0000847800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880211e5000 pfn:0x211e0 head:ffffea0000847800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000694e08 ffffea0002111e08 ffff888011042000 raw: ffff8880211e5000 0000000000080004 00000001ffffffff 0000000000000000 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 26166, ts 892751847534, free_ts 892707798833 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4153 __alloc_pages+0x255/0x580 mm/page_alloc.c:5375 alloc_slab_page mm/slub.c:1763 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1900 new_slab mm/slub.c:1963 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:2994 __slab_alloc mm/slub.c:3081 [inline] slab_alloc_node mm/slub.c:3172 [inline] slab_alloc mm/slub.c:3214 [inline] __kmalloc+0x2e9/0x370 mm/slub.c:4387 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xf4/0x230 net/core/sock.c:1822 sk_alloc+0x35/0x300 net/core/sock.c:1875 __netlink_create+0x68/0x230 net/netlink/af_netlink.c:640 netlink_create+0x368/0x4f0 net/netlink/af_netlink.c:703 __sock_create+0x580/0x8d0 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0x133/0x380 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 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+0xc29/0xd20 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3394 free_slab mm/slub.c:2003 [inline] discard_slab mm/slub.c:2009 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2495 put_cpu_partial+0x132/0x1a0 mm/slub.c:2575 do_slab_free mm/slub.c:3471 [inline] ___cache_free+0xe6/0x120 mm/slub.c:3490 qlist_free_all mm/kasan/quarantine.c:165 [inline] kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3214 [inline] kmem_cache_alloc+0x1c3/0x300 mm/slub.c:3219 sock_alloc_inode+0x17/0xb0 net/socket.c:303 alloc_inode fs/inode.c:237 [inline] new_inode_pseudo+0x61/0x220 fs/inode.c:938 sock_alloc net/socket.c:626 [inline] __sock_create+0x12b/0x8d0 net/socket.c:1428 sock_create net/socket.c:1515 [inline] __sys_socket+0x133/0x380 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880211e6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880211e7000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880211e7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880211e7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880211e7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================