================================================================== BUG: KASAN: use-after-free in hci_conn_del+0x578/0x5c0 net/bluetooth/hci_conn.c:663 Write of size 8 at addr ffff88811c700928 by task syz-executor.3/6079 CPU: 1 PID: 6079 Comm: syz-executor.3 Not tainted 5.12.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:79 [inline] dump_stack+0x10c/0x14b lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 hci_conn_del+0x578/0x5c0 net/bluetooth/hci_conn.c:663 hci_conn_hash_flush+0x153/0x1e0 net/bluetooth/hci_conn.c:1599 hci_dev_do_close+0x4c8/0xe50 net/bluetooth/hci_core.c:1778 hci_unregister_dev+0x20d/0xe60 net/bluetooth/hci_core.c:3989 vhci_release+0x62/0xd0 drivers/bluetooth/hci_vhci.c:340 __fput+0x209/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:140 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0xac8/0x25b0 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_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x464909 Code: Unable to access opcode bytes at RIP 0x4648df. RSP: 002b:00007ffeaf5c9d08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00000000000000fc RCX: 0000000000464909 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 00000000004ae1ea R08: 000000000000000b R09: 0000000000025d42 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000025d46 R14: 0000000000025d42 R15: 000000000000000e Allocated by task 10240: 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:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] __kasan_kmalloc+0x78/0x90 mm/kasan/common.c:515 kasan_kmalloc include/linux/kasan.h:233 [inline] __do_kmalloc mm/slab.c:3695 [inline] __kmalloc+0x22f/0x440 mm/slab.c:3704 kmalloc include/linux/slab.h:559 [inline] tomoyo_realpath_from_path+0xb0/0x6a0 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x19c/0x410 security/tomoyo/file.c:723 security_file_ioctl+0x44/0x80 security/security.c:1495 __do_sys_ioctl fs/ioctl.c:747 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x99/0x190 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 10240: 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:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xac/0xe0 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] __cache_free mm/slab.c:3440 [inline] kfree+0x10f/0x2d0 mm/slab.c:3796 tomoyo_realpath_from_path+0x14b/0x6a0 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x19c/0x410 security/tomoyo/file.c:723 security_file_ioctl+0x44/0x80 security/security.c:1495 __do_sys_ioctl fs/ioctl.c:747 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x99/0x190 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88811c700000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2344 bytes inside of 4096-byte region [ffff88811c700000, ffff88811c701000) The buggy address belongs to the page: page:00000000185161aa refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11c700 head:00000000185161aa order:1 compound_mapcount:0 flags: 0x17ffe0000010200(slab|head) raw: 017ffe0000010200 ffffea0004853208 ffffea000427d788 ffff888100040900 raw: 0000000000000000 ffff88811c700000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88811c700800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811c700880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811c700900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811c700980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811c700a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================