R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000003 R13: 00007f7bee3a7010 R14: 00007ffff14e4d70 R15: 00007f7bee3a7025 udc dummy_udc.0: failed to start USB Gadget filesystem: -12 gadgetfs gadget.0: probe with driver gadgetfs failed with error -12 gadgetfs: bound to dummy_udc driver ================================================================== BUG: KASAN: slab-use-after-free in __raw_spin_lock_irq include/linux/spinlock_api_smp.h:142 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_irq+0x3d/0x50 kernel/locking/spinlock.c:174 Read of size 1 at addr ffff88807fa0f818 by task syz-executor149/6077 CPU: 0 UID: 0 PID: 6077 Comm: syz-executor149 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 __kasan_check_byte+0x2a/0x40 mm/kasan/common.c:574 kasan_check_byte include/linux/kasan.h:402 [inline] lock_acquire+0x84/0x350 kernel/locking/lockdep.c:5842 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock_irq+0x3d/0x50 kernel/locking/spinlock.c:174 spin_lock_irq include/linux/spinlock.h:372 [inline] gadget_dev_open+0x4b/0x1b0 drivers/usb/gadget/legacy/inode.c:1919 do_dentry_open+0x816/0x1380 fs/open.c:947 vfs_open+0x3b/0x340 fs/open.c:1052 do_open fs/namei.c:4700 [inline] path_openat+0x2e44/0x3830 fs/namei.c:4863 do_file_open+0x23e/0x4a0 fs/namei.c:4892 do_sys_openat2+0x115/0x200 fs/open.c:1368 do_sys_open fs/open.c:1374 [inline] __do_sys_openat fs/open.c:1390 [inline] __se_sys_openat fs/open.c:1385 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1385 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7bee36ceb7 Code: 48 89 fa 4c 89 df e8 98 1e 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007ffff14e4cb0 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000555558852400 RCX: 00007f7bee36ceb7 RDX: 0000000000000002 RSI: 00007ffff14e4d70 RDI: ffffffffffffff9c RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000003 R13: 00007f7bee3a7010 R14: 00007ffff14e4d70 R15: 00007f7bee3a7025 Allocated by task 6019: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x32d/0x660 mm/slub.c:5489 _kmalloc_noprof include/linux/slab.h:988 [inline] _kzalloc_noprof include/linux/slab.h:1309 [inline] dev_new drivers/usb/gadget/legacy/inode.c:176 [inline] gadgetfs_fill_super+0x27b/0x790 drivers/usb/gadget/legacy/inode.c:2054 vfs_get_super fs/super.c:1273 [inline] get_tree_single+0xc0/0x150 fs/super.c:1300 vfs_get_tree+0x92/0x2a0 fs/super.c:1700 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3841 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6077: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/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+0x1c5/0x640 mm/slub.c:6692 put_dev drivers/usb/gadget/legacy/inode.c:169 [inline] dev_release+0x164/0x200 drivers/usb/gadget/legacy/inode.c:1215 __fput+0x418/0xa50 fs/file_table.c:512 fput_close_sync+0x11f/0x240 fs/file_table.c:617 __do_sys_close fs/open.c:1511 [inline] __se_sys_close fs/open.c:1496 [inline] __x64_sys_close+0x7e/0x110 fs/open.c:1496 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807fa0f800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 24 bytes inside of freed 1024-byte region [ffff88807fa0f800, ffff88807fa0fc00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7fa08 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b004dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b004dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000800100010 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5632, tgid 5632 (syz-executor), ts 86542408772, free_ts 86515101336 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab+0x79/0x5e0 mm/slub.c:3380 new_slab mm/slub.c:3426 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x2bf/0x6b0 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kmalloc_noprof+0x485/0x720 mm/slub.c:5359 _kmalloc_noprof include/linux/slab.h:992 [inline] _kzalloc_noprof include/linux/slab.h:1309 [inline] tomoyo_init_log+0x1aae/0x1fa0 security/tomoyo/audit.c:273 tomoyo_supervisor+0x35f/0x1560 security/tomoyo/common.c:2232 tomoyo_audit_path_number_log security/tomoyo/file.c:239 [inline] tomoyo_path_number_perm+0x463/0x5f0 security/tomoyo/file.c:739 security_path_chmod+0x132/0x330 security/security.c:1581 chmod_common+0x1a7/0x470 fs/open.c:632 do_fchmodat+0x12d/0x230 fs/open.c:682 __do_sys_chmod fs/open.c:706 [inline] __se_sys_chmod fs/open.c:704 [inline] __x64_sys_chmod+0x62/0x70 fs/open.c:704 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5630 tgid 5630 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0xc1e/0xd10 mm/page_alloc.c:2950 __slab_free+0x274/0x2c0 mm/slub.c:5741 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 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_lru_noprof+0x2aa/0x5f0 mm/slub.c:4950 __d_alloc+0x37/0x6f0 fs/dcache.c:1902 d_alloc_parallel+0xde/0x16a0 fs/dcache.c:2761 __lookup_slow+0x82/0x2f0 fs/namei.c:1904 lookup_slow+0x53/0x70 fs/namei.c:1936 walk_component fs/namei.c:2282 [inline] link_path_walk+0x12a5/0x1910 fs/namei.c:2653 path_lookupat+0xe4/0x8c0 fs/namei.c:2812 filename_lookup+0x265/0x5d0 fs/namei.c:2842 do_readlinkat+0xe3/0x510 fs/stat.c:571 __do_sys_readlinkat fs/stat.c:599 [inline] __se_sys_readlinkat fs/stat.c:596 [inline] __x64_sys_readlinkat+0x9a/0xb0 fs/stat.c:596 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 Memory state around the buggy address: ffff88807fa0f700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807fa0f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807fa0f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807fa0f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807fa0f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================