================================================================== BUG: KASAN: slab-use-after-free in find_endpoint+0x2a3/0x2c0 drivers/usb/gadget/udc/dummy_hcd.c:1618 Read of size 1 at addr ffff8880335938e8 by task kworker/u8:26/21160 CPU: 0 UID: 0 PID: 21160 Comm: kworker/u8:26 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026 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 find_endpoint+0x2a3/0x2c0 drivers/usb/gadget/udc/dummy_hcd.c:1618 dummy_timer+0x500/0x3700 drivers/usb/gadget/udc/dummy_hcd.c:1890 __run_hrtimer kernel/time/hrtimer.c:2067 [inline] __hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2124 hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2141 handle_softirqs+0x1e6/0x9d0 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0x194/0x210 kernel/softirq.c:767 irq_exit_rcu+0x9/0x30 kernel/softirq.c:784 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 RIP: 0010:kasan_unpoison+0x43/0x60 mm/kasan/shadow.c:183 Code: 31 d2 48 89 fb 48 83 c6 01 e8 f9 fa ff ff 48 89 e8 83 e0 07 74 14 48 ba 00 00 00 00 00 fc ff df 48 01 eb 48 c1 eb 03 88 04 13 <5b> 5d e9 c6 06 54 09 90 0f 0b 90 e9 bd 06 54 09 66 66 2e 0f 1f 84 RSP: 0018:ffffc9000452fa50 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff88807f7fa000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffed100feff600 RBP: 0000000000001000 R08: 000000008f1f73ea R09: 0000000000000000 R10: ffffed100feff400 R11: 0000000000000000 R12: ffff88801c034140 R13: 0000000000000d40 R14: ffff88807f7fa000 R15: 0000000000001000 unpoison_slab_object mm/kasan/common.c:336 [inline] __kasan_slab_alloc+0x4e/0x90 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4683 [inline] slab_alloc_node mm/slub.c:4996 [inline] __kmalloc_cache_noprof+0x278/0x6d0 mm/slub.c:5559 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] tomoyo_dump_page+0x410/0x540 security/tomoyo/domain.c:916 tomoyo_environ security/tomoyo/domain.c:638 [inline] tomoyo_find_next_domain+0xcd4/0x2010 security/tomoyo/domain.c:889 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:102 [inline] tomoyo_bprm_check_security+0x12d/0x1d0 security/tomoyo/tomoyo.c:92 security_bprm_check+0x87/0x1e0 security/security.c:820 search_binary_handler fs/exec.c:1749 [inline] exec_binprm fs/exec.c:1791 [inline] bprm_execve fs/exec.c:1847 [inline] bprm_execve+0x80b/0x1940 fs/exec.c:1823 kernel_execve+0x31e/0x3a0 fs/exec.c:1991 call_usermodehelper_exec_async+0x239/0x4b0 kernel/umh.c:107 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 8603: 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:5414 [inline] __kmalloc_noprof+0x32f/0x840 mm/slub.c:5439 _kmalloc_noprof include/linux/slab.h:995 [inline] usb_copy_descriptors+0xcd/0x320 drivers/usb/gadget/config.c:82 f_midi2_bind+0x1dad/0x2770 drivers/usb/gadget/function/f_midi2.c:2026 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+0x210/0x460 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+0x6af/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 21105: 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:2748 [inline] slab_free mm/slub.c:6499 [inline] kfree+0x22b/0x6d0 mm/slub.c:6792 usb_free_descriptors include/linux/usb/gadget.h:903 [inline] usb_free_all_descriptors+0x81/0x1a0 drivers/usb/gadget/config.c:151 purge_configs_funcs+0x285/0x510 drivers/usb/gadget/configfs.c:1600 configfs_composite_unbind+0xae/0x210 drivers/usb/gadget/configfs.c:1846 gadget_unbind_driver+0x20c/0x4f0 drivers/usb/gadget/udc/core.c:1724 device_remove+0xcb/0x180 drivers/base/dd.c:616 __device_release_driver drivers/base/dd.c:1349 [inline] device_release_driver_internal+0x44e/0x620 drivers/base/dd.c:1372 driver_detach+0xd8/0x1b0 drivers/base/dd.c:1435 bus_remove_driver+0x13b/0x2e0 drivers/base/bus.c:832 driver_unregister+0x76/0xb0 drivers/base/driver.c:202 usb_gadget_unregister_driver+0x49/0x70 drivers/usb/gadget/udc/core.c:1784 unregister_gadget drivers/usb/gadget/configfs.c:263 [inline] gadget_dev_desc_UDC_store+0x170/0x2e0 drivers/usb/gadget/configfs.c:290 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+0x6af/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888033593800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 232 bytes inside of freed 512-byte region [ffff888033593800, ffff888033593a00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888033593000 pfn:0x33590 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801c02fc80 ffffea0001f23b10 ffffea00009eac10 raw: ffff888033593000 000000000010000f 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801c02fc80 ffffea0001f23b10 ffffea00009eac10 head: ffff888033593000 000000000010000f 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8603, tgid 8591 (syz.5.757), ts 288645198205 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab mm/slub.c:3462 [inline] new_slab+0xa9/0x6e0 mm/slub.c:3513 refill_objects+0xe3/0x410 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __kmalloc_cache_noprof+0x4f4/0x6d0 mm/slub.c:5559 _kmalloc_noprof include/linux/slab.h:991 [inline] snd_mixer_oss_build_test+0x7a/0x380 sound/core/oss/mixer_oss.c:893 snd_mixer_oss_build_test_all+0x4c8/0x6e0 sound/core/oss/mixer_oss.c:978 snd_mixer_oss_build_input+0x139/0xd50 sound/core/oss/mixer_oss.c:1017 snd_mixer_oss_build sound/core/oss/mixer_oss.c:1276 [inline] snd_mixer_oss_notify_handler+0x48d/0x990 sound/core/oss/mixer_oss.c:1344 snd_card_register+0x2af/0x760 sound/core/init.c:935 f_midi2_create_card drivers/usb/gadget/function/f_midi2.c:1616 [inline] f_midi2_bind+0x1198/0x2770 drivers/usb/gadget/function/f_midi2.c:1948 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 page last free pid 7413 tgid 7412 ts 188601471456 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4683 [inline] slab_alloc_node mm/slub.c:4996 [inline] kmem_cache_alloc_noprof+0x269/0x6a0 mm/slub.c:5010 ptlock_alloc+0x1f/0x70 mm/memory.c:7721 ptlock_init include/linux/mm.h:3884 [inline] pagetable_pte_ctor include/linux/mm.h:3933 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:79 [inline] pte_alloc_one+0x82/0x3d0 arch/x86/mm/pgtable.c:18 __pte_alloc+0x6d/0x380 mm/memory.c:453 copy_pte_range mm/memory.c:1335 [inline] copy_pmd_range mm/memory.c:1490 [inline] copy_pud_range mm/memory.c:1527 [inline] copy_p4d_range mm/memory.c:1551 [inline] copy_page_range+0x3b36/0x57c0 mm/memory.c:1637 dup_mmap+0x1230/0x2370 mm/mmap.c:1819 dup_mm kernel/fork.c:1543 [inline] copy_mm kernel/fork.c:1595 [inline] copy_process+0x4811/0x8370 kernel/fork.c:2307 kernel_clone+0x176/0x9d0 kernel/fork.c:2766 __do_sys_clone+0xd9/0x120 kernel/fork.c:2908 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888033593780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888033593800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888033593880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888033593900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888033593980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 31 d2 xor %edx,%edx 2: 48 89 fb mov %rdi,%rbx 5: 48 83 c6 01 add $0x1,%rsi 9: e8 f9 fa ff ff call 0xfffffb07 e: 48 89 e8 mov %rbp,%rax 11: 83 e0 07 and $0x7,%eax 14: 74 14 je 0x2a 16: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 1d: fc ff df 20: 48 01 eb add %rbp,%rbx 23: 48 c1 eb 03 shr $0x3,%rbx 27: 88 04 13 mov %al,(%rbx,%rdx,1) * 2a: 5b pop %rbx <-- trapping instruction 2b: 5d pop %rbp 2c: e9 c6 06 54 09 jmp 0x95406f7 31: 90 nop 32: 0f 0b ud2 34: 90 nop 35: e9 bd 06 54 09 jmp 0x95406f7 3a: 66 data16 3b: 66 data16 3c: 2e cs 3d: 0f .byte 0xf 3e: 1f (bad) 3f: 84 .byte 0x84