================================================================== BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_inc include/asm-generic/atomic-instrumented.h:240 [inline] BUG: KASAN: use-after-free in hci_sock_bind+0x587/0x1340 net/bluetooth/hci_sock.c:1250 Write of size 4 at addr ffff8880508e9250 by task syz-executor.0/10973 CPU: 1 PID: 10973 Comm: syz-executor.0 Not tainted 5.8.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:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:192 instrument_atomic_write include/linux/instrumented.h:71 [inline] atomic_inc include/asm-generic/atomic-instrumented.h:240 [inline] hci_sock_bind+0x587/0x1340 net/bluetooth/hci_sock.c:1250 __sys_bind+0x1e9/0x250 net/socket.c:1657 __do_sys_bind net/socket.c:1668 [inline] __se_sys_bind net/socket.c:1666 [inline] __x64_sys_bind+0x6f/0xb0 net/socket.c:1666 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45cb19 Code: Bad RIP value. RSP: 002b:00007f0a02b81c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000031 RAX: ffffffffffffffda RBX: 00000000004da140 RCX: 000000000045cb19 RDX: 0000000000000006 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 000000000000002d R14: 00000000004c2fff R15: 00007f0a02b826d4 Allocated by task 10973: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:494 kmem_cache_alloc_trace+0x14f/0x2d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] hci_alloc_dev+0x3e/0x1ff0 net/bluetooth/hci_core.c:3376 __vhci_create_device+0xf7/0x5b0 drivers/bluetooth/hci_vhci.c:99 vhci_create_device drivers/bluetooth/hci_vhci.c:148 [inline] vhci_get_user drivers/bluetooth/hci_vhci.c:205 [inline] vhci_write+0x2b6/0x450 drivers/bluetooth/hci_vhci.c:285 call_write_iter include/linux/fs.h:1907 [inline] new_sync_write+0x422/0x650 fs/read_write.c:484 __vfs_write+0xc9/0x100 fs/read_write.c:497 vfs_write+0x268/0x5d0 fs/read_write.c:559 ksys_write+0x12d/0x250 fs/read_write.c:612 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 10965: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0xf5/0x140 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x103/0x2c0 mm/slab.c:3757 bt_host_release+0x15/0x20 net/bluetooth/hci_sysfs.c:86 device_release+0x71/0x200 drivers/base/core.c:1559 kobject_cleanup lib/kobject.c:693 [inline] kobject_release lib/kobject.c:722 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c0/0x270 lib/kobject.c:739 put_device+0x1b/0x30 drivers/base/core.c:2779 vhci_release+0x78/0xe0 drivers/bluetooth/hci_vhci.c:341 __fput+0x33c/0x880 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:123 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop arch/x86/entry/common.c:216 [inline] __prepare_exit_to_usermode+0x1e9/0x1f0 arch/x86/entry/common.c:246 do_syscall_64+0x6c/0xe0 arch/x86/entry/common.c:368 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8880508e8000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4688 bytes inside of 8192-byte region [ffff8880508e8000, ffff8880508ea000) The buggy address belongs to the page: page:ffffea0001423a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 head:ffffea0001423a00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea0001250d08 ffffea000126a708 ffff8880aa0021c0 raw: 0000000000000000 ffff8880508e8000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880508e9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880508e9180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880508e9200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880508e9280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880508e9300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================