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:691 Read of size 8 at addr ffff8880223bfff0 by task syz.2.8954/8223 CPU: 3 UID: 0 PID: 8223 Comm: syz.2.8954 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:691 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:0xf708efec Code: Unable to access opcode bytes at 0xf708efc2. RSP: 002b:00000000f547d50c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000d00 RDX: 000000000000000b 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 12913: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4584 [inline] slab_alloc_node mm/slub.c:4917 [inline] kmem_cache_alloc_noprof+0x26b/0x6a0 mm/slub.c:4931 sk_prot_alloc+0x60/0x2a0 net/core/sock.c:2246 sk_alloc+0x36/0xe80 net/core/sock.c:2308 inet_create net/ipv4/af_inet.c:333 [inline] inet_create+0x3a0/0x1060 net/ipv4/af_inet.c:259 __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 Freed by task 12523: 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] kmem_cache_free+0x127/0x6b0 mm/slub.c:6504 sk_prot_free net/core/sock.c:2289 [inline] __sk_destruct+0x62a/0xab0 net/core/sock.c:2391 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 Last potentially related work creation: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 __call_rcu_common.constprop.0+0xa5/0x9b0 kernel/rcu/tree.c:3159 sk_destruct+0x91/0xf0 net/core/sock.c:2417 __sk_free+0xf4/0x3e0 net/core/sock.c:2430 sk_free+0x61/0x90 net/core/sock.c:2441 sock_put include/net/sock.h:2020 [inline] ip_ra_destroy_rcu+0x86/0xc0 net/ipv4/ip_sockglue.c:339 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 run_ksoftirqd kernel/softirq.c:1076 [inline] run_ksoftirqd+0x38/0x60 kernel/softirq.c:1068 smpboot_thread_fn+0x3d3/0xaa0 kernel/smpboot.c:160 kthread+0x370/0x450 kernel/kthread.c:436 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff8880223bf800 which belongs to the cache RAW of size 1792 The buggy address is located 240 bytes to the right of allocated 1792-byte region [ffff8880223bf800, ffff8880223bff00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880223bb480 pfn:0x223b8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888025643e01 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff888020f29cc0 ffff888021890588 ffffea00004ed810 raw: ffff8880223bb480 0000000800110010 00000000f5000000 ffff888025643e01 head: 00fff00000000240 ffff888020f29cc0 ffff888021890588 ffffea00004ed810 head: ffff8880223bb480 0000000800110010 00000000f5000000 ffff888025643e01 head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 3688883172, free_ts 0 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 refill_objects+0xe3/0x410 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x376/0x680 mm/slub.c:4675 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:2246 sk_alloc+0x36/0xe80 net/core/sock.c:2308 inet_create net/ipv4/af_inet.c:333 [inline] inet_create+0x3a0/0x1060 net/ipv4/af_inet.c:259 __sock_create+0x339/0x860 net/socket.c:1651 inet_ctl_sock_create+0x94/0x230 net/ipv4/af_inet.c:1639 tcp_v4_init+0x12a/0x310 net/ipv4/tcp_ipv4.c:3652 tcp_init+0x8fd/0x980 net/ipv4/tcp.c:5377 inet_init+0x4a3/0x640 net/ipv4/af_inet.c:1970 do_one_initcall+0x11d/0x700 init/main.c:1347 page_owner free stack trace missing Memory state around the buggy address: ffff8880223bfe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880223bff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880223bff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880223c0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff8880223c0080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================