==================================================================
BUG: KASAN: slab-use-after-free in string_nocheck lib/vsprintf.c:645 [inline]
BUG: KASAN: slab-use-after-free in string+0x394/0x3d0 lib/vsprintf.c:727
Read of size 1 at addr ffff8881083a76a8 by task kworker/0:6/5404

CPU: 0 PID: 5404 Comm: kworker/0:6 Not tainted 6.5.0-syzkaller-gb84acc11b1c9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: usb_hub_wq hub_event
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xc4/0x620 mm/kasan/report.c:475
 kasan_report+0xda/0x110 mm/kasan/report.c:588
 string_nocheck lib/vsprintf.c:645 [inline]
 string+0x394/0x3d0 lib/vsprintf.c:727
 vsnprintf+0xc5f/0x1870 lib/vsprintf.c:2818
 add_uevent_var+0x17c/0x390 lib/kobject_uevent.c:665
 input_dev_uevent+0x162/0x8f0 drivers/input/input.c:1691
 dev_uevent+0x305/0x760 drivers/base/core.c:2599
 kobject_uevent_env+0x623/0x1800 lib/kobject_uevent.c:557
 device_del+0x642/0xa50 drivers/base/core.c:3829
 input_unregister_device+0xb9/0x100 drivers/input/input.c:2440
 hidinput_disconnect+0x160/0x3d0 drivers/hid/hid-input.c:2369
 hid_disconnect+0x143/0x1b0 drivers/hid/hid-core.c:2273
 hid_hw_stop+0x16/0x70 drivers/hid/hid-core.c:2322
 uclogic_remove+0x47/0x90 drivers/hid/hid-uclogic-core.c:485
 hid_device_remove+0xce/0x250 drivers/hid/hid-core.c:2682
 device_remove+0xc8/0x170 drivers/base/dd.c:567
 __device_release_driver drivers/base/dd.c:1272 [inline]
 device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
 bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
 device_del+0x39a/0xa50 drivers/base/core.c:3811
 hid_remove_device drivers/hid/hid-core.c:2859 [inline]
 hid_destroy_device+0xe5/0x150 drivers/hid/hid-core.c:2879
 usbhid_disconnect+0xa0/0xe0 drivers/hid/usbhid/hid-core.c:1456
 usb_unbind_interface+0x1dd/0x8d0 drivers/usb/core/driver.c:458
 device_remove drivers/base/dd.c:569 [inline]
 device_remove+0x11f/0x170 drivers/base/dd.c:561
 __device_release_driver drivers/base/dd.c:1272 [inline]
 device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
 bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
 device_del+0x39a/0xa50 drivers/base/core.c:3811
 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416
 usb_disconnect+0x2e1/0x890 drivers/usb/core/hub.c:2252
 hub_port_connect drivers/usb/core/hub.c:5280 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5580 [inline]
 port_event drivers/usb/core/hub.c:5740 [inline]
 hub_event+0x1be0/0x4f30 drivers/usb/core/hub.c:5822
 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
 process_scheduled_works kernel/workqueue.c:2667 [inline]
 worker_thread+0x896/0x1110 kernel/workqueue.c:2753
 kthread+0x33a/0x430 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
 </TASK>

Allocated by task 5404:
 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
 kasan_set_track+0x25/0x30 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x87/0x90 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:196 [inline]
 __do_kmalloc_node mm/slab_common.c:1023 [inline]
 __kmalloc_node_track_caller+0x61/0x100 mm/slab_common.c:1043
 alloc_dr drivers/base/devres.c:119 [inline]
 devm_kmalloc+0xa5/0x230 drivers/base/devres.c:829
 devm_kzalloc include/linux/device.h:314 [inline]
 uclogic_input_configured+0x251/0x610 drivers/hid/hid-uclogic-core.c:151
 hidinput_connect+0x1bf8/0x2b60 drivers/hid/hid-input.c:2327
 hid_connect+0x139e/0x18a0 drivers/hid/hid-core.c:2187
 hid_hw_start drivers/hid/hid-core.c:2302 [inline]
 hid_hw_start+0xa0/0x130 drivers/hid/hid-core.c:2293
 uclogic_probe+0x235/0x380 drivers/hid/hid-uclogic-core.c:221
 __hid_device_probe drivers/hid/hid-core.c:2626 [inline]
 hid_device_probe+0x2e4/0x480 drivers/hid/hid-core.c:2663
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x234/0xc90 drivers/base/dd.c:658
 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
 device_add+0x1182/0x1ac0 drivers/base/core.c:3622
 hid_add_device+0x371/0xa60 drivers/hid/hid-core.c:2809
 usbhid_probe+0xd0a/0x1360 drivers/hid/usbhid/hid-core.c:1429
 usb_probe_interface+0x307/0x930 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x234/0xc90 drivers/base/dd.c:658
 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
 device_add+0x1182/0x1ac0 drivers/base/core.c:3622
 usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207
 usb_generic_driver_probe+0xca/0x130 drivers/usb/core/generic.c:238
 usb_probe_device+0xda/0x2c0 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x234/0xc90 drivers/base/dd.c:658
 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
 device_add+0x1182/0x1ac0 drivers/base/core.c:3622
 usb_new_device+0xd80/0x1960 drivers/usb/core/hub.c:2589
 hub_port_connect drivers/usb/core/hub.c:5440 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5580 [inline]
 port_event drivers/usb/core/hub.c:5740 [inline]
 hub_event+0x2e62/0x4f30 drivers/usb/core/hub.c:5822
 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
 worker_thread+0x687/0x1110 kernel/workqueue.c:2751
 kthread+0x33a/0x430 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

Freed by task 5404:
 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
 kasan_set_track+0x25/0x30 mm/kasan/common.c:52
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
 ____kasan_slab_free mm/kasan/common.c:236 [inline]
 ____kasan_slab_free+0x13c/0x190 mm/kasan/common.c:200
 kasan_slab_free include/linux/kasan.h:162 [inline]
 slab_free_hook mm/slub.c:1800 [inline]
 slab_free_freelist_hook mm/slub.c:1826 [inline]
 slab_free mm/slub.c:3809 [inline]
 __kmem_cache_free+0xff/0x330 mm/slub.c:3822
 release_nodes drivers/base/devres.c:506 [inline]
 devres_release_all+0x192/0x240 drivers/base/devres.c:535
 device_del+0x628/0xa50 drivers/base/core.c:3826
 input_unregister_device+0xb9/0x100 drivers/input/input.c:2440
 hidinput_disconnect+0x160/0x3d0 drivers/hid/hid-input.c:2369
 hid_disconnect+0x143/0x1b0 drivers/hid/hid-core.c:2273
 hid_hw_stop+0x16/0x70 drivers/hid/hid-core.c:2322
 uclogic_remove+0x47/0x90 drivers/hid/hid-uclogic-core.c:485
 hid_device_remove+0xce/0x250 drivers/hid/hid-core.c:2682
 device_remove+0xc8/0x170 drivers/base/dd.c:567
 __device_release_driver drivers/base/dd.c:1272 [inline]
 device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
 bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
 device_del+0x39a/0xa50 drivers/base/core.c:3811
 hid_remove_device drivers/hid/hid-core.c:2859 [inline]
 hid_destroy_device+0xe5/0x150 drivers/hid/hid-core.c:2879
 usbhid_disconnect+0xa0/0xe0 drivers/hid/usbhid/hid-core.c:1456
 usb_unbind_interface+0x1dd/0x8d0 drivers/usb/core/driver.c:458
 device_remove drivers/base/dd.c:569 [inline]
 device_remove+0x11f/0x170 drivers/base/dd.c:561
 __device_release_driver drivers/base/dd.c:1272 [inline]
 device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
 bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
 device_del+0x39a/0xa50 drivers/base/core.c:3811
 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416
 usb_disconnect+0x2e1/0x890 drivers/usb/core/hub.c:2252
 hub_port_connect drivers/usb/core/hub.c:5280 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5580 [inline]
 port_event drivers/usb/core/hub.c:5740 [inline]
 hub_event+0x1be0/0x4f30 drivers/usb/core/hub.c:5822
 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
 process_scheduled_works kernel/workqueue.c:2667 [inline]
 worker_thread+0x896/0x1110 kernel/workqueue.c:2753
 kthread+0x33a/0x430 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304

The buggy address belongs to the object at ffff8881083a7680
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 40 bytes inside of
 freed 64-byte region [ffff8881083a7680, ffff8881083a76c0)

The buggy address belongs to the physical page:
page:ffffea000420e9c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1083a7
flags: 0x200000000000800(slab|node=0|zone=2)
page_type: 0xffffffff()
raw: 0200000000000800 ffff888100041640 ffffea00044aa280 dead000000000002
raw: 0000000000000000 0000000000200020 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 33, tgid 33 (kworker/u4:2), ts 9667525258, free_ts 9666482622
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
 prep_new_page mm/page_alloc.c:1543 [inline]
 get_page_from_freelist+0x10e1/0x2fd0 mm/page_alloc.c:3183
 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439
 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298
 alloc_slab_page mm/slub.c:1870 [inline]
 allocate_slab+0x251/0x380 mm/slub.c:2017
 new_slab mm/slub.c:2070 [inline]
 ___slab_alloc+0x8be/0x1570 mm/slub.c:3223
 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
 __slab_alloc_node mm/slub.c:3375 [inline]
 slab_alloc_node mm/slub.c:3468 [inline]
 __kmem_cache_alloc_node+0x132/0x310 mm/slub.c:3517
 __do_kmalloc_node mm/slab_common.c:1022 [inline]
 __kmalloc_node+0x52/0x110 mm/slab_common.c:1030
 kmalloc_node include/linux/slab.h:619 [inline]
 __vmalloc_area_node mm/vmalloc.c:3125 [inline]
 __vmalloc_node_range+0x3e9/0x1540 mm/vmalloc.c:3320
 alloc_thread_stack_node kernel/fork.c:309 [inline]
 dup_task_struct kernel/fork.c:1121 [inline]
 copy_process+0x13de/0x7300 kernel/fork.c:2334
 kernel_clone+0xfc/0x860 kernel/fork.c:2916
 user_mode_thread+0xb4/0xf0 kernel/fork.c:2994
 call_usermodehelper_exec_work kernel/umh.c:172 [inline]
 call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:158
 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600
 worker_thread+0x687/0x1110 kernel/workqueue.c:2751
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+0x460/0xa20 mm/page_alloc.c:2312
 free_unref_page_list+0xd5/0x8a0 mm/page_alloc.c:2451
 release_pages+0xbdd/0x1230 mm/swap.c:1042
 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98
 tlb_flush_mmu_free mm/mmu_gather.c:293 [inline]
 tlb_flush_mmu mm/mmu_gather.c:300 [inline]
 tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:392
 exit_mmap+0x38b/0xa60 mm/mmap.c:3223
 __mmput kernel/fork.c:1356 [inline]
 mmput+0xdb/0x420 kernel/fork.c:1378
 free_bprm+0x144/0x3f0 fs/exec.c:1492
 kernel_execve+0x3e7/0x4e0 fs/exec.c:2026
 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110
 ret_from_fork+0x45/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:
 ffff8881083a7580: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff8881083a7600: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
>ffff8881083a7680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                                  ^
 ffff8881083a7700: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
 ffff8881083a7780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================