configfs-gadget.g1 gadget.0: uvc: Unable to allocate streaming EP ================================================================== BUG: KASAN: slab-out-of-bounds in list_empty include/linux/list.h:373 [inline] BUG: KASAN: slab-out-of-bounds in dummy_free_request+0x3f/0x70 drivers/usb/gadget/udc/dummy_hcd.c:690 Read of size 8 at addr ffff888079d202f0 by task syz.0.399/7197 CPU: 1 PID: 7197 Comm: syz.0.399 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xa8/0x210 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 list_empty include/linux/list.h:373 [inline] dummy_free_request+0x3f/0x70 drivers/usb/gadget/udc/dummy_hcd.c:690 uvc_function_bind+0xd5f/0x1530 drivers/usb/gadget/function/f_uvc.c:880 usb_add_function+0x2dd/0x980 drivers/usb/gadget/composite.c:333 configfs_composite_bind+0xde4/0x13f0 drivers/usb/gadget/configfs.c:1800 gadget_bind_driver+0x2b3/0x770 drivers/usb/gadget/udc/core.c:1651 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x247/0xae0 drivers/base/dd.c:717 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:879 driver_probe_device+0x4f/0x420 drivers/base/dd.c:909 __driver_attach+0x444/0x6d0 drivers/base/dd.c:1295 bus_for_each_dev+0x235/0x2b0 drivers/base/bus.c:370 bus_add_driver+0x340/0x630 drivers/base/bus.c:723 driver_register+0x23a/0x310 drivers/base/driver.c:246 usb_gadget_register_driver_owner+0xf9/0x270 drivers/usb/gadget/udc/core.c:1730 gadget_dev_desc_UDC_store+0x1c7/0x2e0 drivers/usb/gadget/configfs.c:300 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x312/0x400 fs/configfs/file.c:229 call_write_iter include/linux/fs.h:2018 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x474/0x9a0 fs/read_write.c:584 ksys_write+0x151/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7febb039e019 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007febb1210028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007febb0625fa0 RCX: 00007febb039e019 RDX: 000000000000000c RSI: 0000200000000680 RDI: 0000000000000005 RBP: 00007febb043500c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007febb0626038 R14: 00007febb0625fa0 R15: 00007ffc6a5beef8 Allocated by task 5143: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:53 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] kernfs_get_open_node fs/kernfs/file.c:592 [inline] kernfs_fop_open+0x790/0xc60 fs/kernfs/file.c:760 do_dentry_open+0x880/0x14b0 fs/open.c:929 do_open fs/namei.c:3640 [inline] path_openat+0x284f/0x3270 fs/namei.c:3801 do_filp_open+0x1f2/0x430 fs/namei.c:3828 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x139/0x160 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 5821: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:53 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1811 [inline] slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837 slab_free mm/slub.c:3830 [inline] kmem_cache_free_bulk+0x357/0x470 mm/slub.c:3948 kfree_bulk include/linux/slab.h:517 [inline] kvfree_rcu_bulk+0x1eb/0x470 kernel/rcu/tree.c:3032 kvfree_rcu_drain_ready kernel/rcu/tree.c:3216 [inline] kfree_rcu_monitor+0x7d3/0xf70 kernel/rcu/tree.c:3234 process_one_work kernel/workqueue.c:2653 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2730 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2811 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:46 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492 kvfree_call_rcu+0xee/0x780 kernel/rcu/tree.c:3452 kernfs_unlink_open_file+0x457/0x500 fs/kernfs/file.c:653 kernfs_fop_release+0x12e/0x190 fs/kernfs/file.c:825 __fput+0x221/0x940 fs/file_table.c:418 __do_sys_close fs/open.c:1574 [inline] __se_sys_close+0x15c/0x1e0 fs/open.c:1559 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Second to last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:46 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492 kvfree_call_rcu+0xee/0x780 kernel/rcu/tree.c:3452 kernfs_unlink_open_file+0x457/0x500 fs/kernfs/file.c:653 kernfs_fop_release+0x12e/0x190 fs/kernfs/file.c:825 __fput+0x221/0x940 fs/file_table.c:418 __do_sys_close fs/open.c:1574 [inline] __se_sys_close+0x15c/0x1e0 fs/open.c:1559 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff888079d20200 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 112 bytes to the right of allocated 128-byte region [ffff888079d20200, ffff888079d20280) The buggy address belongs to the physical page: page:ffffea0001e74800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79d20 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888017c418c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5991, tgid 5990 (syz.2.39), ts 106663075694, free_ts 106658690143 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582 prep_new_page mm/page_alloc.c:1589 [inline] get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501 alloc_slab_page+0x5d/0x180 mm/slub.c:1881 allocate_slab mm/slub.c:2028 [inline] new_slab+0x87/0x2d0 mm/slub.c:2081 ___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253 __slab_alloc mm/slub.c:3339 [inline] __slab_alloc_node mm/slub.c:3392 [inline] slab_alloc_node mm/slub.c:3485 [inline] __kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0xa7/0x240 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] copy_gadget_strings drivers/usb/gadget/composite.c:1446 [inline] usb_gstrings_attach+0xe8/0xd80 drivers/usb/gadget/composite.c:1512 configfs_attach_gadget_strings drivers/usb/gadget/configfs.c:1670 [inline] configfs_composite_bind+0x5bf/0x13f0 drivers/usb/gadget/configfs.c:1726 gadget_bind_driver+0x2b3/0x770 drivers/usb/gadget/udc/core.c:1651 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x247/0xae0 drivers/base/dd.c:717 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:879 driver_probe_device+0x4f/0x420 drivers/base/dd.c:909 __driver_attach+0x444/0x6d0 drivers/base/dd.c:1295 bus_for_each_dev+0x235/0x2b0 drivers/base/bus.c:370 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1182 [inline] free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459 vfree+0x1a7/0x340 mm/vmalloc.c:2868 delayed_vfree_work+0x55/0x80 mm/vmalloc.c:2788 process_one_work kernel/workqueue.c:2653 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2730 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2811 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 Memory state around the buggy address: ffff888079d20180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079d20200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888079d20280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888079d20300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888079d20380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================