================================================================== BUG: KASAN: slab-out-of-bounds in create_monitor_event+0x88d/0x930 net/bluetooth/hci_sock.c:491 Read of size 8 at addr ffff88801324cfcf by task syz-executor.2/30006 CPU: 0 PID: 30006 Comm: syz-executor.2 Not tainted 6.6.0-rc6-syzkaller-00043-gdd72f9c7e512 #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+0x88d/0x930 net/bluetooth/hci_sock.c:491 send_monitor_replay+0x7a/0x5d0 net/bluetooth/hci_sock.c:723 hci_sock_bind+0x85c/0x1140 net/bluetooth/hci_sock.c:1387 __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:0x7f23e8c7cae9 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:00007f23e9a320c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000031 RAX: ffffffffffffffda RBX: 00007f23e8d9bf80 RCX: 00007f23e8c7cae9 RDX: 0000000000000006 RSI: 0000000020000100 RDI: 0000000000000004 RBP: 00007f23e8cc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f23e8d9bf80 R15: 00007fff24854f58 Allocated by task 5065: 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+0x153/0xa40 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 ffff88801324cfc8 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 [ffff88801324cfc8, ffff88801324cfcd) The buggy address belongs to the physical page: page:ffffea00004c9300 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801324ceb0 pfn:0x1324c flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888012841280 ffffea000050ac90 ffffea0001f7b790 raw: ffff88801324ceb0 0000000000660065 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 0x12000(__GFP_NOWARN|__GFP_NORETRY), pid 0, tgid 0 (swapper), ts 1664446767, free_ts 0 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_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+0xa8/0x230 mm/slab_common.c:1036 kmalloc_array include/linux/slab.h:636 [inline] kcalloc include/linux/slab.h:667 [inline] cpupri_init kernel/sched/cpupri.c:290 [inline] init_rootdomain+0x2b6/0x440 kernel/sched/topology.c:559 init_defrootdomain+0x10/0x30 kernel/sched/topology.c:585 sched_init+0x15c/0xcb0 kernel/sched/core.c:9956 start_kernel+0x1ab/0x4f0 init/main.c:940 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:556 x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:537 secondary_startup_64_no_verify+0x167/0x16b page_owner free stack trace missing Memory state around the buggy address: ffff88801324ce80: fc 00 fc fc fc fc fb fc fc fc fc fa fc fc fc fc ffff88801324cf00: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc fa >ffff88801324cf80: fc fc fc fc fa fc fc fc fc 05 fc fc fc fc fc fc ^ ffff88801324d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801324d080: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ==================================================================