udc dummy_udc.1: failed to start USB Gadget filesystem: -12 gadgetfs gadget.1: probe with driver gadgetfs failed with error -12 udc dummy_udc.2: failed to start USB Gadg udc dummy_udc.2: failed to start USB Gadget filesystem: -12 gadgetfs gadget.2: probe with driver gadgetfs failed with error -12 ================================================================== BUG: KASAN: slab-use-after-free in gadgetfs_bind+0x82e/0x890 drivers/usb/gadget/legacy/inode.c:1691 Write of size 8 at addr ffff88807c6e18c0 by task syz.2.646/7555 CPU: 0 UID: 0 PID: 7555 Comm: syz.2.646 Not tainted syzkaller #0 PREEMPT(full) 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 gadgetfs_bind+0x82e/0x890 drivers/usb/gadget/legacy/inode.c:1691 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 dev_config+0xdce/0x1610 drivers/usb/gadget/legacy/inode.c:1892 vfs_write+0x2aa/0x1050 fs/read_write.c:685 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 RIP: 0033:0x7f0c5a59e159 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:00007f0c5b450028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f0c5a825fa0 RCX: 00007f0c5a59e159 RDX: 000000000000001f RSI: 0000200000000400 RDI: 0000000000000006 RBP: 00007f0c5a635024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f0c5a826038 R14: 00007f0c5a825fa0 R15: 00007ffc27d8cf78 Allocated by task 5606: 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] __kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5563 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] dev_new drivers/usb/gadget/legacy/inode.c:176 [inline] gadgetfs_fill_super+0x1da/0x430 drivers/usb/gadget/legacy/inode.c:2063 vfs_get_super fs/super.c:1405 [inline] get_tree_single+0xe2/0x190 fs/super.c:1432 vfs_get_tree+0x92/0x320 fs/super.c:1947 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3772 [inline] do_new_mount fs/namespace.c:3848 [inline] path_mount+0x7d0/0x24c0 fs/namespace.c:4168 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount fs/namespace.c:4374 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4374 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 7555: 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 put_dev+0xb4/0xd0 drivers/usb/gadget/legacy/inode.c:169 gadgetfs_bind+0x6bc/0x890 drivers/usb/gadget/legacy/inode.c:1712 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 dev_config+0xdce/0x1610 drivers/usb/gadget/legacy/inode.c:1892 vfs_write+0x2aa/0x1050 fs/read_write.c:685 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 ffff88807c6e1800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 192 bytes inside of freed 1024-byte region [ffff88807c6e1800, ffff88807c6e1c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88807c6e4800 pfn:0x7c6e0 head: order:3 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 ffff88801c02edc0 ffffea0000b8d810 ffffea000078fe10 raw: ffff88807c6e4800 0000000000100008 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801c02edc0 ffffea0000b8d810 ffffea000078fe10 head: ffff88807c6e4800 0000000000100008 00000000f5000000 0000000000000000 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5715, tgid 5715 (kworker/0:5), ts 63403494224 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] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_noprof+0x67c/0x840 mm/slub.c:5439 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] neigh_alloc net/core/neighbour.c:518 [inline] ___neigh_create+0x1532/0x2940 net/core/neighbour.c:652 ip6_finish_output2+0x1052/0x1d50 net/ipv6/ip6_output.c:130 __ip6_finish_output+0x357/0xdf0 net/ipv6/ip6_output.c:210 ip6_finish_output net/ipv6/ip6_output.c:221 [inline] NF_HOOK_COND include/linux/netfilter.h:314 [inline] ip6_output+0x2aa/0xa60 net/ipv6/ip6_output.c:248 dst_output include/net/dst.h:470 [inline] NF_HOOK include/linux/netfilter.h:325 [inline] NF_HOOK.constprop.0+0x115/0x5a0 include/linux/netfilter.h:319 mld_sendpack+0x8f7/0xec0 net/ipv6/mcast.c:1890 mld_send_cr net/ipv6/mcast.c:2191 [inline] mld_ifc_work+0x75a/0xc10 net/ipv6/mcast.c:2739 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 page last free pid 5606 tgid 5606 ts 63376488678 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 alloc_filename fs/namei.c:147 [inline] do_getname_kernel+0x5d/0x250 fs/namei.c:266 getname_kernel fs/namei.c:289 [inline] class_filename_kernel_constructor include/linux/fs.h:2585 [inline] kern_path+0x1f/0x50 fs/namei.c:3035 tomoyo_mount_acl+0x685/0x8b0 security/tomoyo/mount.c:138 tomoyo_mount_permission+0x214/0x460 security/tomoyo/mount.c:239 security_sb_mount+0xdd/0x270 security/security.c:1088 path_mount+0x158/0x24c0 fs/namespace.c:4110 do_mount fs/namespace.c:4181 [inline] __do_sys_mount fs/namespace.c:4397 [inline] __se_sys_mount fs/namespace.c:4374 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4374 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: ffff88807c6e1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807c6e1800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807c6e1880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807c6e1900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807c6e1980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================