================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] BUG: KASAN: slab-use-after-free in __refcount_add include/linux/refcount.h:182 [inline] BUG: KASAN: slab-use-after-free in __refcount_inc include/linux/refcount.h:239 [inline] BUG: KASAN: slab-use-after-free in refcount_inc include/linux/refcount.h:256 [inline] BUG: KASAN: slab-use-after-free in sock_hold include/net/sock.h:760 [inline] BUG: KASAN: slab-use-after-free in sco_conn_del+0x9c/0x498 net/bluetooth/sco.c:195 Write of size 4 at addr ffff00011adf6080 by task syz-executor.4/6254 CPU: 0 PID: 6254 Comm: syz-executor.4 Not tainted 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:291 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x178/0x518 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 kasan_check_range+0x254/0x294 mm/kasan/generic.c:189 __kasan_check_write+0x20/0x30 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] __refcount_add include/linux/refcount.h:182 [inline] __refcount_inc include/linux/refcount.h:239 [inline] refcount_inc include/linux/refcount.h:256 [inline] sock_hold include/net/sock.h:760 [inline] sco_conn_del+0x9c/0x498 net/bluetooth/sco.c:195 sco_disconn_cfm+0x8c/0xdc net/bluetooth/sco.c:1371 hci_disconn_cfm include/net/bluetooth/hci_core.h:2001 [inline] hci_conn_hash_flush+0x100/0x220 net/bluetooth/hci_conn.c:2645 hci_dev_close_sync+0x7d8/0xf20 net/bluetooth/hci_sync.c:4957 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x1e4/0x4a8 net/bluetooth/hci_core.c:2740 vhci_release+0x7c/0xd0 drivers/bluetooth/hci_vhci.c:674 __fput+0x30c/0x738 fs/file_table.c:376 ____fput+0x20/0x30 fs/file_table.c:404 task_work_run+0x230/0x2e0 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x618/0x1f64 kernel/exit.c:871 do_group_exit+0x194/0x22c kernel/exit.c:1020 __do_sys_exit_group kernel/exit.c:1031 [inline] __se_sys_exit_group kernel/exit.c:1029 [inline] pid_child_should_wake+0x0/0x1dc kernel/exit.c:1029 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Allocated by task 6538: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:575 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3981 [inline] __kmalloc+0x2bc/0x5d4 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] sk_prot_alloc+0xc4/0x1f0 net/core/sock.c:2078 sk_alloc+0x44/0x3f0 net/core/sock.c:2131 bt_sock_alloc+0x4c/0x304 net/bluetooth/af_bluetooth.c:148 sco_sock_alloc net/bluetooth/sco.c:495 [inline] sco_sock_create+0xbc/0x31c net/bluetooth/sco.c:526 bt_sock_create+0x14c/0x248 net/bluetooth/af_bluetooth.c:132 __sock_create+0x43c/0x884 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x134/0x340 net/socket.c:1706 __do_sys_socket net/socket.c:1720 [inline] __se_sys_socket net/socket.c:1718 [inline] __arm64_sys_socket+0x7c/0x94 net/socket.c:1718 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Freed by task 6538: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:589 poison_slab_object+0x124/0x18c mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x144/0x3cc mm/slub.c:4409 sk_prot_free net/core/sock.c:2114 [inline] __sk_destruct+0x4b8/0x74c net/core/sock.c:2206 sk_destruct net/core/sock.c:2221 [inline] __sk_free+0x388/0x4f4 net/core/sock.c:2232 sk_free+0x60/0xc8 net/core/sock.c:2243 sock_put include/net/sock.h:1961 [inline] sco_sock_kill+0xfc/0x1b4 net/bluetooth/sco.c:426 sco_sock_release+0x1fc/0x2c0 net/bluetooth/sco.c:1256 __sock_release net/socket.c:659 [inline] sock_close+0xa4/0x1e8 net/socket.c:1421 __fput+0x30c/0x738 fs/file_table.c:376 ____fput+0x20/0x30 fs/file_table.c:404 task_work_run+0x230/0x2e0 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x618/0x1f64 kernel/exit.c:871 do_group_exit+0x194/0x22c kernel/exit.c:1020 get_signal+0x1500/0x15ec kernel/signal.c:2893 do_signal+0x238/0x3e8c arch/arm64/kernel/signal.c:1308 do_notify_resume+0x74/0x1f4 arch/arm64/kernel/entry-common.c:148 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:169 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:178 [inline] el0_svc+0xac/0x168 arch/arm64/kernel/entry-common.c:713 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff00011adf6000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of freed 2048-byte region [ffff00011adf6000, ffff00011adf6800) The buggy address belongs to the physical page: page:0000000050ef729a refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15adf0 head:0000000050ef729a order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000840(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000840 ffff0000c0002000 fffffdffc4e4fe00 dead000000000002 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff00011adf5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff00011adf6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff00011adf6080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff00011adf6100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff00011adf6180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 0 PID: 6254 at lib/refcount.c:25 refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 Modules linked in: CPU: 0 PID: 6254 Comm: syz-executor.4 Tainted: G B 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 lr : refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 sp : ffff800098307820 x29: ffff800098307820 x28: dfff800000000000 x27: 0000000000000067 x26: 1fffe0001aa45550 x25: 0000000000000000 x24: ffff0000c8b57a08 x23: ffff800091ac8880 x22: ffff00011adf6000 x21: 0000000000000002 x20: ffff00011adf6080 x19: ffff800091cc2000 x18: 1fffe000367fff96 x17: 0000000000000000 x16: ffff80008aca6b80 x15: 0000000000000001 x14: 1ffff00013060e20 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000003 x10: 0000000000ff0100 x9 : 6a23c1b5349bc100 x8 : 6a23c1b5349bc100 x7 : fffffffffffc3520 x6 : fffffffffffc34f0 x5 : ffff800098307118 x4 : ffff80008ed535c8 x3 : ffff80008036f0d8 x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000000 Call trace: refcount_warn_saturate+0x1a8/0x20c lib/refcount.c:25 __refcount_inc include/linux/refcount.h:239 [inline] refcount_inc include/linux/refcount.h:256 [inline] sock_hold include/net/sock.h:760 [inline] sco_conn_del+0x240/0x498 net/bluetooth/sco.c:195 sco_disconn_cfm+0x8c/0xdc net/bluetooth/sco.c:1371 hci_disconn_cfm include/net/bluetooth/hci_core.h:2001 [inline] hci_conn_hash_flush+0x100/0x220 net/bluetooth/hci_conn.c:2645 hci_dev_close_sync+0x7d8/0xf20 net/bluetooth/hci_sync.c:4957 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x1e4/0x4a8 net/bluetooth/hci_core.c:2740 vhci_release+0x7c/0xd0 drivers/bluetooth/hci_vhci.c:674 __fput+0x30c/0x738 fs/file_table.c:376 ____fput+0x20/0x30 fs/file_table.c:404 task_work_run+0x230/0x2e0 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x618/0x1f64 kernel/exit.c:871 do_group_exit+0x194/0x22c kernel/exit.c:1020 __do_sys_exit_group kernel/exit.c:1031 [inline] __se_sys_exit_group kernel/exit.c:1029 [inline] pid_child_should_wake+0x0/0x1dc kernel/exit.c:1029 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 irq event stamp: 191995 hardirqs last enabled at (191995): [] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:85 [inline] hardirqs last enabled at (191995): [] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:95 hardirqs last disabled at (191994): [] __do_softirq+0x958/0xce4 kernel/softirq.c:569 softirqs last enabled at (190214): [] softirq_handle_end kernel/softirq.c:399 [inline] softirqs last enabled at (190214): [] __do_softirq+0xac8/0xce4 kernel/softirq.c:582 softirqs last disabled at (190191): [] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 6254 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 Modules linked in: CPU: 0 PID: 6254 Comm: syz-executor.4 Tainted: G B W 6.8.0-rc7-syzkaller-g707081b61156 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 lr : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 sp : ffff800098307820 x29: ffff800098307820 x28: dfff800000000000 x27: 0000000000000067 x26: 1fffe0001aa45550 x25: 0000000000000000 x24: ffff00011adf6550 x23: 00000000c0000000 x22: ffff00011adf6000 x21: 0000000000000003 x20: ffff00011adf6080 x19: ffff800091cc2000 x18: 1fffe000367fff96 x17: ffff80008ec9d000 x16: ffff800080276f8c x15: 0000000000000001 x14: 1fffe0001a451dfb x13: 0000000000000000 x12: 0000000000000000 x11: ffff60001a451dfc x10: 0000000000ff0100 x9 : 6a23c1b5349bc100 x8 : 6a23c1b5349bc100 x7 : 1fffe000367fff97 x6 : ffff8000802b8388 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff8000801cda30 x2 : 0000000000000001 x1 : 0000000000000002 x0 : 0000000000000000 Call trace: refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 __refcount_sub_and_test include/linux/refcount.h:272 [inline] __refcount_dec_and_test include/linux/refcount.h:304 [inline] refcount_dec_and_test include/linux/refcount.h:322 [inline] sock_put include/net/sock.h:1960 [inline] sco_conn_del+0x3e8/0x498 net/bluetooth/sco.c:203 sco_disconn_cfm+0x8c/0xdc net/bluetooth/sco.c:1371 hci_disconn_cfm include/net/bluetooth/hci_core.h:2001 [inline] hci_conn_hash_flush+0x100/0x220 net/bluetooth/hci_conn.c:2645 hci_dev_close_sync+0x7d8/0xf20 net/bluetooth/hci_sync.c:4957 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_unregister_dev+0x1e4/0x4a8 net/bluetooth/hci_core.c:2740 vhci_release+0x7c/0xd0 drivers/bluetooth/hci_vhci.c:674 __fput+0x30c/0x738 fs/file_table.c:376 ____fput+0x20/0x30 fs/file_table.c:404 task_work_run+0x230/0x2e0 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x618/0x1f64 kernel/exit.c:871 do_group_exit+0x194/0x22c kernel/exit.c:1020 __do_sys_exit_group kernel/exit.c:1031 [inline] __se_sys_exit_group kernel/exit.c:1029 [inline] pid_child_should_wake+0x0/0x1dc kernel/exit.c:1029 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 irq event stamp: 191995 hardirqs last enabled at (191995): [] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:85 [inline] hardirqs last enabled at (191995): [] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:95 hardirqs last disabled at (191994): [] __do_softirq+0x958/0xce4 kernel/softirq.c:569 softirqs last enabled at (190214): [] softirq_handle_end kernel/softirq.c:399 [inline] softirqs last enabled at (190214): [] __do_softirq+0xac8/0xce4 kernel/softirq.c:582 softirqs last disabled at (190191): [] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81 ---[ end trace 0000000000000000 ]---