8, 8, create_monitor_event, ffff888016b70be0 ================================================================== BUG: KASAN: slab-out-of-bounds in create_monitor_event+0x976/0x9c0 net/bluetooth/hci_sock.c:496 Read of size 8 at addr ffff888016b70be7 by task syz-executor.0/5457 CPU: 0 PID: 5457 Comm: syz-executor.0 Not tainted 6.6.0-rc4-syzkaller-00158-gf291209eca5e-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 create_monitor_event+0x976/0x9c0 net/bluetooth/hci_sock.c:496 send_monitor_replay+0x7a/0x5d0 net/bluetooth/hci_sock.c:728 hci_sock_bind+0x85c/0x1140 net/bluetooth/hci_sock.c:1392 __sys_bind+0x23a/0x2e0 net/socket.c:1849 __do_sys_bind net/socket.c:1860 [inline] __se_sys_bind net/socket.c:1858 [inline] __x64_sys_bind+0x7a/0x90 net/socket.c:1858 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f3616e7cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3617b2a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000031 RAX: ffffffffffffffda RBX: 00007f3616f9bf80 RCX: 00007f3616e7cae9 RDX: 0000000000000006 RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007f3616ec847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f3616f9bf80 R15: 00007ffd3cce9288 Allocated by task 5393: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1023 [inline] __kmalloc_node_track_caller+0xb6/0x230 mm/slab_common.c:1043 kvasprintf+0xdf/0x190 lib/kasprintf.c:25 kobject_set_name_vargs+0x61/0x120 lib/kobject.c:272 dev_set_name+0xd5/0x120 drivers/base/core.c:3427 hci_register_dev+0x154/0xaf0 net/bluetooth/hci_core.c:2620 __vhci_create_device drivers/bluetooth/hci_vhci.c:434 [inline] vhci_create_device+0x3ba/0x720 drivers/bluetooth/hci_vhci.c:475 vhci_get_user drivers/bluetooth/hci_vhci.c:532 [inline] vhci_write+0x3c7/0x480 drivers/bluetooth/hci_vhci.c:612 call_write_iter include/linux/fs.h:1956 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x782/0xaf0 fs/read_write.c:584 ksys_write+0x1a0/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888016b70be0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 2 bytes to the right of allocated 5-byte region [ffff888016b70be0, ffff888016b70be5) The buggy address belongs to the physical page: page:ffffea00005adc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16b70 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888012841280 ffffea000050a580 dead000000000002 raw: 0000000000000000 0000000000660066 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 8209251422, free_ts 8189848851 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 alloc_page_interleave+0x22/0x1d0 mm/mempolicy.c:2130 alloc_slab_page+0x6a/0x160 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc_node_track_caller+0xa5/0x230 mm/slab_common.c:1043 kstrdup+0x3a/0x70 mm/util.c:62 __kernfs_new_node+0x9d/0x870 fs/kernfs/dir.c:611 kernfs_new_node fs/kernfs/dir.c:679 [inline] kernfs_create_dir_ns+0x94/0x230 fs/kernfs/dir.c:1040 sysfs_create_dir_ns+0x189/0x390 fs/sysfs/dir.c:59 create_dir lib/kobject.c:73 [inline] kobject_add_internal+0x61d/0xc30 lib/kobject.c:238 kobject_add_varg lib/kobject.c:372 [inline] kobject_add+0x152/0x210 lib/kobject.c:424 device_add+0x4b5/0xd30 drivers/base/core.c:3562 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2405 vfree+0x186/0x2e0 mm/vmalloc.c:2842 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:2763 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888016b70a80: fc fc fc fc 04 fc fc fc fc 00 fc fc fc fc 05 fc ffff888016b70b00: fc fc fc 06 fc fc fc fc 06 fc fc fc fc 06 fc fc >ffff888016b70b80: fc fc 04 fc fc fc fc 05 fc fc fc fc 05 fc fc fc ^ ffff888016b70c00: fc 06 fc fc fc fc 06 fc fc fc fc 06 fc fc fc fc ffff888016b70c80: 04 fc fc fc fc fa fc fc fc fc fa fc fc fc fc 06 ==================================================================