================================================================== BUG: KASAN: use-after-free in hci_conn_del+0x578/0x5c0 net/bluetooth/hci_conn.c:663 Write of size 8 at addr ffff888173094978 by task syz-executor.2/4650 CPU: 1 PID: 4650 Comm: syz-executor.2 Not tainted 5.15.0-rc2-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+0xbd/0xe2 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 hci_conn_del+0x578/0x5c0 net/bluetooth/hci_conn.c:663 hci_conn_hash_flush+0x153/0x1e0 net/bluetooth/hci_conn.c:1609 hci_dev_do_close+0x4dc/0xe70 net/bluetooth/hci_core.c:1793 hci_unregister_dev+0x183/0x410 net/bluetooth/hci_core.c:4029 vhci_release+0x62/0xd0 drivers/bluetooth/hci_vhci.c:340 __fput+0x206/0x8d0 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xa7a/0x2570 kernel/exit.c:825 do_group_exit+0xe7/0x290 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+0x35/0x40 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:0x464909 Code: Unable to access opcode bytes at RIP 0x4648df. RSP: 002b:00007ffebd3ec3d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000001155 RCX: 0000000000464909 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 00000000004ae1ea R08: 000000000000000b R09: 000000000004f45d R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000004f4f4 R14: 000000000004f45d R15: 000000000000000e Allocated by task 4664: 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+0x7a/0x90 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __do_kmalloc mm/slab.c:3702 [inline] __kmalloc+0x213/0x470 mm/slab.c:3711 kmalloc include/linux/slab.h:596 [inline] tomoyo_realpath_from_path+0xb0/0x6a0 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x1f1/0x340 security/tomoyo/file.c:822 tomoyo_path_unlink+0x7f/0xd0 security/tomoyo/tomoyo.c:149 security_path_unlink+0xb3/0x110 security/security.c:1155 do_unlinkat+0x2ab/0x550 fs/namei.c:4165 __do_sys_unlink fs/namei.c:4217 [inline] __se_sys_unlink fs/namei.c:4215 [inline] __x64_sys_unlink+0xa0/0xe0 fs/namei.c:4215 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 4664: 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+0xb2/0xe0 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] __cache_free mm/slab.c:3445 [inline] kfree+0x111/0x2d0 mm/slab.c:3803 tomoyo_realpath_from_path+0x14b/0x6a0 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x1f1/0x340 security/tomoyo/file.c:822 tomoyo_path_unlink+0x7f/0xd0 security/tomoyo/tomoyo.c:149 security_path_unlink+0xb3/0x110 security/security.c:1155 do_unlinkat+0x2ab/0x550 fs/namei.c:4165 __do_sys_unlink fs/namei.c:4217 [inline] __se_sys_unlink fs/namei.c:4215 [inline] __x64_sys_unlink+0xa0/0xe0 fs/namei.c:4215 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 The buggy address belongs to the object at ffff888173094000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2424 bytes inside of 4096-byte region [ffff888173094000, ffff888173095000) The buggy address belongs to the page: page:000000000ac24af1 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x173094 head:000000000ac24af1 order:1 compound_mapcount:0 flags: 0x17ffe0000010200(slab|head|node=0|zone=2|lastcpupid=0x3fff) raw: 017ffe0000010200 ffffea0005c6c588 ffffea0005eede08 ffff888100040900 raw: 0000000000000000 ffff888173094000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888173094800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888173094880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888173094900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888173094980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888173094a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================