configfs-gadget.g1 gadget.0: uvc: uvc_function_bind() 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 ffff88802adb98f0 by task syz.3.1764/13515 CPU: 0 UID: 0 PID: 13515 Comm: syz.3.1764 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:0xf704efec Code: Unable to access opcode bytes at 0xf704efc2. RSP: 002b:00000000f543d50c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000080000280 RDX: 000000000000000c RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 10385: 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_flags_noprof+0x371/0x8b0 mm/slub.c:5528 _kmalloc_flags_noprof mm/slab.h:39 [inline] __alloc_empty_sheaf mm/slub.c:2751 [inline] alloc_empty_sheaf mm/slub.c:2771 [inline] __pcs_replace_empty_main+0x41a/0x680 mm/slub.c:4670 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] kmem_cache_alloc_noprof+0x46e/0x6a0 mm/slub.c:4931 sk_prot_alloc+0x60/0x2a0 net/core/sock.c:2245 sk_alloc+0x36/0xe80 net/core/sock.c:2307 smc_sock_alloc net/smc/af_smc.c:428 [inline] smc_create+0x11a/0x290 net/smc/af_smc.c:3390 __sock_create+0x339/0x860 net/socket.c:1651 sock_create net/socket.c:1709 [inline] __sys_socket_create net/socket.c:1746 [inline] __sys_socket+0x14d/0x260 net/socket.c:1793 __do_sys_socket net/socket.c:1807 [inline] __se_sys_socket net/socket.c:1805 [inline] __ia32_sys_socket+0x72/0xb0 net/socket.c:1805 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 ffff88802adb9800 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 [ffff88802adb9800, ffff88802adb9880) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2adb9 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 5736, tgid 5736 (syz-executor), ts 50729882014, free_ts 49968608102 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_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 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] __do_kmalloc_node mm/slub.c:5333 [inline] __kvmalloc_node_noprof+0x73d/0x970 mm/slub.c:6905 xt_alloc_table_info+0x44/0xa0 net/netfilter/x_tables.c:1286 arpt_register_table+0xaf/0x2c0 net/ipv4/netfilter/arp_tables.c:1531 arptable_filter_table_init+0x40/0x60 net/ipv4/netfilter/arptable_filter.c:39 xt_find_table_lock+0x2db/0x520 net/netfilter/x_tables.c:1353 xt_request_find_table_lock+0x28/0xf0 net/netfilter/x_tables.c:1378 get_info+0x1a4/0x600 net/ipv4/netfilter/arp_tables.c:818 do_arpt_get_ctl+0x1bd/0x9a0 net/ipv4/netfilter/arp_tables.c:1465 page last free pid 5844 tgid 5844 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 __pagetable_free include/linux/mm.h:3695 [inline] pagetable_free include/linux/mm.h:3719 [inline] pagetable_dtor_free include/linux/mm.h:3818 [inline] __tlb_remove_table include/asm-generic/tlb.h:221 [inline] __tlb_remove_table_free mm/mmu_gather.c:228 [inline] tlb_remove_table_rcu+0x2cf/0x380 mm/mmu_gather.c:291 rcu_do_batch kernel/rcu/tree.c:2645 [inline] rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2897 handle_softirqs+0x1ea/0x9b0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0x162/0x210 kernel/softirq.c:735 irq_exit_rcu+0x9/0x30 kernel/softirq.c:752 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 Memory state around the buggy address: ffff88802adb9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802adb9800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802adb9880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802adb9900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802adb9980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================