================================================================== BUG: KASAN: slab-use-after-free in sco_chan_del+0xe6/0x440 Write of size 4 at addr ffff888009770010 by task syz-executor.2/23449 CPU: 0 PID: 23449 Comm: syz-executor.2 Not tainted 6.5.0-rc6-next-20230818 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x91/0xf0 print_report+0xcc/0x620 kasan_report+0xbe/0xf0 kasan_check_range+0x39/0x1b0 sco_chan_del+0xe6/0x440 __sco_sock_close+0x21e/0x770 sco_sock_release+0xa1/0x400 __sock_release+0xb3/0x270 sock_close+0x1c/0x30 __fput+0x400/0xa70 task_work_run+0x174/0x280 get_signal+0x1d3/0x2720 arch_do_signal_or_restart+0x81/0x790 exit_to_user_mode_prepare+0xeb/0x180 syscall_exit_to_user_mode+0x1d/0x50 do_syscall_64+0x4c/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7f62228e4b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f621fe5a188 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffffc RBX: 00007f62229f7f60 RCX: 00007f62228e4b19 RDX: 0000000000000008 RSI: 0000000020000040 RDI: 0000000000000004 RBP: 00007f622293ef6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff67e14a4f R14: 00007f621fe5a300 R15: 0000000000022000 Allocated by task 23449: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 __kasan_kmalloc+0x7f/0x90 hci_conn_add+0xab/0x16c0 hci_connect_sco+0x3e2/0x1090 sco_sock_connect+0x2c2/0x9e0 __sys_connect_file+0x165/0x1b0 __sys_connect+0x169/0x1a0 __x64_sys_connect+0x73/0xb0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Freed by task 22247: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2b/0x50 __kasan_slab_free+0x10a/0x190 __kmem_cache_free+0xe1/0x330 device_release+0xa6/0x240 kobject_put+0x177/0x270 put_device+0x1f/0x30 hci_conn_unlink+0x515/0x720 hci_conn_del+0x4b/0xc40 hci_abort_conn_sync+0xad3/0xdf0 abort_conn_sync+0x18f/0x3b0 hci_cmd_sync_work+0x14a/0x2a0 process_one_work+0x7c8/0x1450 worker_thread+0x80e/0x1190 kthread+0x33f/0x440 ret_from_fork+0x48/0x80 ret_from_fork_asm+0x1b/0x30 Last potentially related work creation: kasan_save_stack+0x22/0x50 __kasan_record_aux_stack+0x8e/0xa0 __queue_work+0x5e6/0x1380 queue_work_on+0xb6/0xc0 rcu_core+0x8e1/0x28f0 __do_softirq+0x1b7/0x7d4 Second to last potentially related work creation: kasan_save_stack+0x22/0x50 __kasan_record_aux_stack+0x8e/0xa0 __call_rcu_common.constprop.0+0x6a/0xbd0 deactivate_locked_super+0x147/0x170 deactivate_super+0xb1/0xd0 cleanup_mnt+0x2ae/0x3d0 mntput_no_expire+0x9c7/0xb60 mntput+0x6b/0x90 free_ipc+0x184/0x2d0 process_one_work+0x7c8/0x1450 worker_thread+0x80e/0x1190 kthread+0x33f/0x440 ret_from_fork+0x48/0x80 ret_from_fork_asm+0x1b/0x30 The buggy address belongs to the object at ffff888009770000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 16 bytes inside of freed 4096-byte region [ffff888009770000, ffff888009771000) The buggy address belongs to the physical page: page:00000000933e13f0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9770 head:00000000933e13f0 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x100000000000840(slab|head|node=0|zone=1) page_type: 0xffffffff() raw: 0100000000000840 ffff888008442140 ffffea0000fd0000 dead000000000002 raw: 0000000000000000 0000000080040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88800976ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88800976ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888009770000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888009770080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888009770100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Bluetooth: hci1: command 0x0405 tx timeout Bluetooth: hci1: command 0x0405 tx timeout