================================================================== BUG: KASAN: use-after-free in notifier_chain_register+0x1bd/0x210 Read of size 4 at addr ffff88801192d118 by task syz-executor.3/4204 CPU: 0 PID: 4204 Comm: syz-executor.3 Not tainted 6.0.0-rc3-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: dump_stack_lvl+0x14f/0x1be print_report.cold+0x2ba/0x6e9 kasan_report+0xb1/0x1e0 notifier_chain_register+0x1bd/0x210 blocking_notifier_chain_register+0x6f/0xc0 hci_register_suspend_notifier+0x9d/0xc0 hci_register_dev+0x5ed/0xa90 __vhci_create_device+0x393/0x7d0 vhci_write+0x2b5/0x460 vfs_write+0x9e9/0xdd0 ksys_write+0x127/0x250 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x463b49 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:00007f3df66db188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000055bf00 RCX: 0000000000463b49 RDX: 0000000000000002 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00000000004ae538 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bf00 R13: 00007ffd6336fc4f R14: 00007f3df66db300 R15: 0000000000022000 Allocated by task 4198: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x7f/0xa0 __kmalloc+0x20a/0x460 hci_alloc_dev_priv+0x1e/0x2570 __vhci_create_device+0xf9/0x7d0 vhci_write+0x2b5/0x460 vfs_write+0x9e9/0xdd0 ksys_write+0x127/0x250 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 4196: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 ____kasan_slab_free+0x122/0x180 kfree+0x17b/0x3a0 hci_release_dev+0x4c5/0x5d0 bt_host_release+0x66/0xa0 device_release+0x9f/0x240 kobject_put+0x171/0x270 put_device+0x1b/0x30 vhci_release+0x84/0xf0 __fput+0x277/0x9d0 task_work_run+0xdd/0x1a0 exit_to_user_mode_prepare+0x1ea/0x1f0 syscall_exit_to_user_mode+0x16/0x40 do_syscall_64+0x42/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0x62/0x70 insert_work+0x48/0x350 __queue_work+0x61b/0x1240 queue_work_on+0x147/0x1b0 hci_register_dev+0x63a/0xa90 __vhci_create_device+0x393/0x7d0 vhci_write+0x2b5/0x460 vfs_write+0x9e9/0xdd0 ksys_write+0x127/0x250 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 __kasan_record_aux_stack+0x62/0x70 insert_work+0x48/0x350 __queue_work+0x61b/0x1240 queue_work_on+0x147/0x1b0 hci_register_dev+0x63a/0xa90 __vhci_create_device+0x393/0x7d0 vhci_write+0x2b5/0x460 vfs_write+0x9e9/0xdd0 ksys_write+0x127/0x250 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88801192c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4376 bytes inside of 8192-byte region [ffff88801192c000, ffff88801192e000) The buggy address belongs to the physical page: page:00000000417690ad refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1192c head:00000000417690ad order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfffe0000010200(slab|head|node=0|zone=1|lastcpupid=0x3fff) raw: 00fffe0000010200 ffffea0000b20708 ffffea0000b80c08 ffff88800e040a00 raw: 0000000000000000 ffff88801192c000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801192d000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801192d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801192d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801192d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801192d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================