configfs-gadget.g1 gadget.0: uvc: Unable to allocate streaming EP ================================================================== BUG: KASAN: slab-out-of-bounds in list_empty include/linux/list.h:404 [inline] BUG: KASAN: slab-out-of-bounds in dummy_free_request+0x8a/0x90 drivers/usb/gadget/udc/dummy_hcd.c:710 Read of size 8 at addr ffff88802224c5f0 by task syz.3.4374/21753 CPU: 0 UID: 0 PID: 21753 Comm: syz.3.4374 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 list_empty include/linux/list.h:404 [inline] dummy_free_request+0x8a/0x90 drivers/usb/gadget/udc/dummy_hcd.c:710 uvc_function_bind+0x181a/0x1939 drivers/usb/gadget/function/f_uvc.c:893 usb_add_function+0x219/0x890 drivers/usb/gadget/composite.c:333 configfs_composite_bind+0xd83/0x1960 drivers/usb/gadget/configfs.c:1802 gadget_bind_driver+0x28c/0xbf0 drivers/usb/gadget/udc/core.c:1662 call_driver_probe drivers/base/dd.c:628 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:706 __driver_probe_device+0x20e/0x450 drivers/base/dd.c:868 driver_probe_device+0x4a/0x140 drivers/base/dd.c:898 __driver_attach+0x21f/0x5b0 drivers/base/dd.c:1292 bus_for_each_dev+0x13e/0x1d0 drivers/base/bus.c:383 bus_add_driver+0x305/0x5b0 drivers/base/bus.c:763 driver_register+0x1e2/0x360 drivers/base/driver.c:174 usb_gadget_register_driver_owner+0x132/0x210 drivers/usb/gadget/udc/core.c:1752 gadget_dev_desc_UDC_store+0x1b0/0x2e0 drivers/usb/gadget/configfs.c:300 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x302/0x4e0 fs/configfs/file.c:229 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf707efec Code: Unable to access opcode bytes at 0xf707efc2. RSP: 002b:00000000f546d50c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00000000800003c0 RDX: 000000000000000c RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 21688: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5334 [inline] __kmalloc_noprof+0x322/0x820 mm/slub.c:5359 _kmalloc_noprof include/linux/slab.h:992 [inline] ovl_cache_entry_new+0x64/0x9d0 fs/overlayfs/readdir.c:183 ovl_fill_plain+0x63/0x220 fs/overlayfs/readdir.c:638 dir_emit_dot include/linux/fs.h:3591 [inline] dir_emit_dots include/linux/fs.h:3602 [inline] offset_readdir+0x424/0x780 fs/libfs.c:560 iterate_dir+0x296/0xae0 fs/readdir.c:110 ovl_dir_read fs/overlayfs/readdir.c:388 [inline] ovl_indexdir_cleanup+0x20f/0x960 fs/overlayfs/readdir.c:1269 ovl_get_indexdir fs/overlayfs/super.c:900 [inline] ovl_fill_super_creds fs/overlayfs/super.c:1474 [inline] ovl_fill_super+0x47da/0x5e30 fs/overlayfs/super.c:1560 vfs_get_super fs/super.c:1273 [inline] get_tree_nodev+0xdd/0x190 fs/super.c:1292 vfs_get_tree+0x92/0x320 fs/super.c:1700 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount fs/namespace.c:3841 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4161 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount fs/namespace.c:4367 [inline] __ia32_sys_mount+0x292/0x310 fs/namespace.c:4367 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 21688: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2677 [inline] slab_free mm/slub.c:6377 [inline] kfree+0x22b/0x6c0 mm/slub.c:6692 ovl_cache_entry_free fs/overlayfs/readdir.c:271 [inline] ovl_cache_free fs/overlayfs/readdir.c:280 [inline] ovl_indexdir_cleanup+0x2df/0x960 fs/overlayfs/readdir.c:1322 ovl_get_indexdir fs/overlayfs/super.c:900 [inline] ovl_fill_super_creds fs/overlayfs/super.c:1474 [inline] ovl_fill_super+0x47da/0x5e30 fs/overlayfs/super.c:1560 vfs_get_super fs/super.c:1273 [inline] get_tree_nodev+0xdd/0x190 fs/super.c:1292 vfs_get_tree+0x92/0x320 fs/super.c:1700 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount fs/namespace.c:3841 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4161 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount fs/namespace.c:4367 [inline] __ia32_sys_mount+0x292/0x310 fs/namespace.c:4367 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88802224c500 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 [ffff88802224c500, ffff88802224c580) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2224c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801bc42a00 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5742, tgid 5742 (syz-executor), ts 56511909517, free_ts 53410275845 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946 __alloc_pages_slowpath mm/page_alloc.c:4821 [inline] __alloc_frozen_pages_noprof+0x6ab/0x2dc0 mm/page_alloc.c:5317 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab mm/slub.c:3380 [inline] new_slab+0xa2/0x640 mm/slub.c:3426 ___slab_alloc+0x5d1/0x800 mm/slub.c:4463 slab_alloc_node mm/slub.c:4908 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kmalloc_flags_noprof+0x473/0x8b0 mm/slub.c:5528 _kmalloc_flags_noprof mm/slab.h:39 [inline] alloc_slab_obj_exts+0x5a/0x160 mm/slub.c:2149 __memcg_slab_post_alloc_hook+0x3d4/0x1160 mm/memcontrol.c:3587 memcg_slab_post_alloc_hook mm/slub.c:2447 [inline] slab_post_alloc_hook mm/slub.c:4603 [inline] slab_alloc_node mm/slub.c:4917 [inline] kmem_cache_alloc_noprof+0x587/0x6a0 mm/slub.c:4931 copy_fs_struct+0x49/0x340 fs/fs_struct.c:109 copy_fs kernel/fork.c:1636 [inline] copy_process+0x50d8/0x8030 kernel/fork.c:2280 kernel_clone+0x176/0x9d0 kernel/fork.c:2748 __do_compat_sys_ia32_clone+0xd4/0x120 arch/x86/kernel/sys_ia32.c:255 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e page last free pid 5950 tgid 5949 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950 __folio_put+0x3b4/0x5f0 mm/swap.c:112 folio_put include/linux/mm.h:2124 [inline] __iommu_free_desc+0x1db/0x260 drivers/iommu/iommu-pages.c:100 iommu_put_pages_list+0x7b/0xd0 drivers/iommu/iommu-pages.c:130 vtdss_deinit+0x1ed/0x290 drivers/iommu/generic_pt/iommu_pt.h:1179 pt_iommu_deinit include/linux/generic_pt/iommu.h:226 [inline] intel_iommu_domain_free+0x128/0x1c0 drivers/iommu/intel/iommu.c:3010 iommu_domain_free+0xcd/0x170 drivers/iommu/iommu.c:2143 iommu_deinit_device+0x47b/0x670 drivers/iommu/iommu.c:600 __iommu_group_remove_device+0x29a/0x390 drivers/iommu/iommu.c:764 iommu_release_device drivers/iommu/iommu.c:783 [inline] iommu_bus_notifier+0xb8/0x110 drivers/iommu/iommu.c:1826 notifier_call_chain+0x99/0x3f0 kernel/notifier.c:85 blocking_notifier_call_chain kernel/notifier.c:380 [inline] blocking_notifier_call_chain+0x69/0xa0 kernel/notifier.c:368 bus_notify+0x56/0x80 drivers/base/bus.c:1086 device_del+0x5f8/0x9b0 drivers/base/core.c:3978 pci_destroy_dev drivers/pci/remove.c:46 [inline] pci_remove_bus_device+0x162/0x3b0 drivers/pci/remove.c:110 pci_stop_and_remove_bus_device_locked+0x1a/0x20 drivers/pci/remove.c:136 Memory state around the buggy address: ffff88802224c480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802224c500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802224c580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802224c600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802224c680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================