================================================================== BUG: KASAN: slab-use-after-free in string_nocheck lib/vsprintf.c:648 [inline] BUG: KASAN: slab-use-after-free in string+0x216/0x2d0 lib/vsprintf.c:730 Read of size 1 at addr ffff88802a67a660 by task syz.0.7/5819 CPU: 1 UID: 0 PID: 5819 Comm: syz.0.7 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 string_nocheck lib/vsprintf.c:648 [inline] string+0x216/0x2d0 lib/vsprintf.c:730 vsnprintf+0x74a/0xef0 lib/vsprintf.c:2949 snprintf+0xe8/0x140 lib/vsprintf.c:3047 set_dev_info drivers/base/core.c:4988 [inline] dev_vprintk_emit+0x30f/0x400 drivers/base/core.c:4998 dev_printk_emit+0xee/0x140 drivers/base/core.c:5011 _dev_err+0x11e/0x180 drivers/base/core.c:5066 raw_process_ep0_io+0x580/0x9f0 drivers/usb/gadget/legacy/raw_gadget.c:730 raw_ioctl_ep0_write drivers/usb/gadget/legacy/raw_gadget.c:767 [inline] raw_ioctl+0x254f/0x41c0 drivers/usb/gadget/legacy/raw_gadget.c:1313 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe59259dd6b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007fe5934b9f50 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007fe59259dd6b RDX: 00007fe5934b9fd0 RSI: 0000000040085503 RDI: 000000000000000c RBP: 00007fe5934b9fd0 R08: 0000000000000011 R09: 0000000000000000 R10: 000000000000000c R11: 0000000000000246 R12: 00007fe5934b9fd8 R13: 0000000000000000 R14: 00007fe592825fa0 R15: 00007ffcfcad98c8 Allocated by task 1: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5414 [inline] __kmalloc_node_track_caller_noprof+0x4b4/0x720 mm/slub.c:5545 kvasprintf+0xeb/0x1a0 lib/kasprintf.c:25 kobject_set_name_vargs+0x61/0x110 lib/kobject.c:274 dev_set_name+0xe2/0x140 drivers/base/core.c:3564 usb_add_gadget+0x475/0x700 drivers/usb/gadget/udc/core.c:1459 usb_add_gadget_udc_release+0x19c/0x1f0 drivers/usb/gadget/udc/core.c:1517 dummy_udc_probe+0x6b1/0x7b0 drivers/usb/gadget/udc/dummy_hcd.c:1121 platform_probe+0xf9/0x190 drivers/base/platform.c:1507 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x254/0xae0 drivers/base/dd.c:706 __driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868 driver_probe_device+0x4f/0x240 drivers/base/dd.c:898 __device_attach_driver+0x270/0x410 drivers/base/dd.c:1026 bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500 __device_attach+0x2c4/0x450 drivers/base/dd.c:1098 device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153 bus_probe_device+0x12a/0x220 drivers/base/bus.c:620 device_add+0x7d7/0xb80 drivers/base/core.c:3776 platform_device_add+0x4bd/0x860 drivers/base/platform.c:833 dummy_hcd_init+0x966/0xd00 drivers/usb/gadget/udc/dummy_hcd.c:2894 do_one_initcall+0x250/0x870 init/main.c:1359 do_initcall_level+0x10a/0x1a0 init/main.c:1421 do_initcalls+0x59/0xa0 init/main.c:1437 kernel_init_freeable+0x29d/0x3e0 init/main.c:1672 kernel_init+0x22/0x1d0 init/main.c:1562 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 5837: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2748 [inline] slab_free mm/slub.c:6499 [inline] kfree+0x1c5/0x650 mm/slub.c:6792 kobject_cleanup lib/kobject.c:695 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x267/0x550 lib/kobject.c:737 device_remove drivers/base/dd.c:616 [inline] __device_release_driver drivers/base/dd.c:1349 [inline] device_release_driver_internal+0x48b/0x880 drivers/base/dd.c:1372 unbind_store+0x1a1/0x1d0 drivers/base/bus.c:244 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802a67a660 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 0 bytes inside of freed 16-byte region [ffff88802a67a660, ffff88802a67a670) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802a67a040 pfn:0x2a67a flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801b041640 ffffea0000ad6b50 ffffea0000a8cb90 raw: ffff88802a67a040 0000000000800079 00000000f5000000 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 0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 13070247176 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x2209/0x2280 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x217/0x5a0 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab+0x7d/0x620 mm/slub.c:3462 new_slab mm/slub.c:3513 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_noprof+0x47b/0x720 mm/slub.c:5439 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] rh_call_control drivers/usb/core/hcd.c:486 [inline] rh_urb_enqueue drivers/usb/core/hcd.c:817 [inline] usb_hcd_submit_urb+0x893/0x1b60 drivers/usb/core/hcd.c:1538 usb_start_wait_urb+0x13f/0x5b0 drivers/usb/core/message.c:62 usb_internal_control_msg drivers/usb/core/message.c:117 [inline] usb_control_msg+0x234/0x3e0 drivers/usb/core/message.c:167 get_hub_status drivers/usb/core/hub.c:589 [inline] hub_hub_status+0xc4/0x5c0 drivers/usb/core/hub.c:996 hub_configure drivers/usb/core/hub.c:1696 [inline] hub_probe+0x21a8/0x3c00 drivers/usb/core/hub.c:2006 usb_probe_interface+0x788/0xe50 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x254/0xae0 drivers/base/dd.c:706 __driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868 driver_probe_device+0x4f/0x240 drivers/base/dd.c:898 page_owner free stack trace missing Memory state around the buggy address: ffff88802a67a500: 00 04 fc fc 00 04 fc fc 00 04 fc fc 00 00 fc fc ffff88802a67a580: 00 04 fc fc 00 04 fc fc 00 04 fc fc 00 04 fc fc >ffff88802a67a600: 00 00 fc fc 00 01 fc fc 00 01 fc fc fa fb fc fc ^ ffff88802a67a680: 00 04 fc fc fa fb fc fc 00 00 fc fc fa fb fc fc ffff88802a67a700: fa fb fc fc fa fb fc fc 00 04 fc fc 00 00 fc fc ==================================================================