================================================================== BUG: KASAN: use-after-free in atomic_inc include/asm-generic/atomic-instrumented.h:239 [inline] BUG: KASAN: use-after-free in hci_sock_bind+0x183f/0x1aa0 net/bluetooth/hci_sock.c:1250 Write of size 4 at addr ffff88804749d250 by task syz-executor.2/5450 CPU: 1 PID: 5450 Comm: syz-executor.2 Not tainted 5.7.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1e9/0x30e lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:382 __kasan_report+0x103/0x1a0 mm/kasan/report.c:511 kasan_report+0x4d/0x80 mm/kasan/common.c:625 Allocated by task 5453: save_stack mm/kasan/common.c:49 [inline] set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc+0x114/0x160 mm/kasan/common.c:495 kmem_cache_alloc_trace+0x234/0x300 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] hci_alloc_dev+0x4c/0x1840 net/bluetooth/hci_core.c:3365 __vhci_create_device drivers/bluetooth/hci_vhci.c:99 [inline] vhci_create_device+0x113/0x520 drivers/bluetooth/hci_vhci.c:148 vhci_get_user drivers/bluetooth/hci_vhci.c:205 [inline] vhci_write+0x36d/0x400 drivers/bluetooth/hci_vhci.c:285 call_write_iter include/linux/fs.h:1907 [inline] new_sync_write fs/read_write.c:484 [inline] __vfs_write+0x54c/0x710 fs/read_write.c:497 vfs_write+0x274/0x580 fs/read_write.c:559 ksys_write+0x11b/0x220 fs/read_write.c:612 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 5445: save_stack mm/kasan/common.c:49 [inline] set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0x125/0x190 mm/kasan/common.c:456 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 bt_host_release+0x18/0x20 net/bluetooth/hci_sysfs.c:86 device_release+0x70/0x1a0 drivers/base/core.c:1390 kobject_cleanup lib/kobject.c:693 [inline] kobject_release lib/kobject.c:722 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1cf/0x290 lib/kobject.c:739 vhci_release+0x7b/0xc0 drivers/bluetooth/hci_vhci.c:341 __fput+0x2ed/0x750 fs/file_table.c:280 task_work_run+0x147/0x1d0 kernel/task_work.c:123 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop arch/x86/entry/common.c:165 [inline] prepare_exit_to_usermode+0x48e/0x600 arch/x86/entry/common.c:196 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff88804749c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4688 bytes inside of 8192-byte region [ffff88804749c000, ffff88804749e000) The buggy address belongs to the page: page:ffffea00011d2700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 head:ffffea00011d2700 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00013e8208 ffffea0001298608 ffff8880aa4021c0 raw: 0000000000000000 ffff88804749c000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804749d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804749d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804749d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804749d280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804749d300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================