================================================================== BUG: KASAN: slab-use-after-free in __mutex_lock_common kernel/locking/mutex.c:625 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock+0x14e/0x15a0 kernel/locking/mutex.c:821 Read of size 8 at addr ffff888053e39c58 by task syz-executor/5650 Read of size 8 at addr ffff888053e39c58 by task syz-executor/5650 CPU: 0 UID: 0 PID: 5650 Comm: syz-executor Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/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 __mutex_lock_common kernel/locking/mutex.c:625 [inline] __mutex_lock+0x14e/0x15a0 kernel/locking/mutex.c:821 ep_open+0x4e/0x270 drivers/usb/gadget/legacy/inode.c:953 do_dentry_open+0x80e/0x1360 fs/open.c:1000 vfs_open_consume+0x4a/0x350 fs/open.c:1131 do_open fs/namei.c:4845 [inline] path_openat+0x16fc/0x20f0 fs/namei.c:5010 do_file_open+0x23e/0x4a0 fs/namei.c:5039 do_sys_openat2+0x115/0x200 fs/open.c:1442 do_sys_open fs/open.c:1448 [inline] __do_sys_openat fs/open.c:1788 [inline] __se_sys_openat fs/open.c:1783 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1783 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f3a3c95fd8e Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08 RSP: 002b:00007ffc9059cd18 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000555573948500 RCX: 00007f3a3c95fd8e RDX: 0000000000000000 RSI: 00007ffc9059ce80 RDI: ffffffffffffff9c RBP: 00007ffc9059ce80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc9059df70 R13: 00007f3a3ca35f63 R14: 00005555739484e8 R15: 0000000000000006 Allocated by task 6574: 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:409 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x31c/0x600 mm/slub.c:5680 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] activate_ep_files drivers/usb/gadget/legacy/inode.c:1732 [inline] gadgetfs_bind+0x2ef/0xb00 drivers/usb/gadget/legacy/inode.c:1825 gadget_bind_driver+0x2ca/0x9e0 drivers/usb/gadget/udc/core.c:1663 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x254/0xae0 drivers/base/dd.c:707 __driver_probe_device+0x1e8/0x360 drivers/base/dd.c:869 driver_probe_device+0x4f/0x240 drivers/base/dd.c:899 __driver_attach+0x34e/0x630 drivers/base/dd.c:1300 bus_for_each_dev+0x23b/0x2c0 drivers/base/bus.c:386 bus_add_driver+0x38f/0x6e0 drivers/base/bus.c:785 driver_register+0x23a/0x320 drivers/base/driver.c:174 usb_gadget_register_driver_owner+0xf9/0x270 drivers/usb/gadget/udc/core.c:1753 dev_config+0xe3c/0x12a0 drivers/usb/gadget/legacy/inode.c:2015 vfs_write+0x296/0xba0 fs/read_write.c:685 ksys_write+0x150/0x270 fs/read_write.c:1036 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6578: 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:264 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:296 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2780 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x1c5/0x650 mm/slub.c:6923 destroy_ep_files+0x29f/0x330 drivers/usb/gadget/legacy/inode.c:1713 gadgetfs_unbind+0x109/0x2b0 drivers/usb/gadget/legacy/inode.c:1786 gadget_unbind_driver+0x1cb/0x410 drivers/usb/gadget/udc/core.c:1725 device_remove drivers/base/dd.c:617 [inline] __device_release_driver drivers/base/dd.c:1357 [inline] device_release_driver_internal+0x42b/0x7d0 drivers/base/dd.c:1380 driver_detach+0x1f3/0x2d0 drivers/base/dd.c:1443 bus_remove_driver+0x226/0x320 drivers/base/bus.c:854 usb_gadget_unregister_driver+0x4e/0x70 drivers/usb/gadget/udc/core.c:1785 dev_release+0x83/0x200 drivers/usb/gadget/legacy/inode.c:1328 __fput+0x408/0xa40 fs/file_table.c:513 fput_close_sync+0x11f/0x240 fs/file_table.c:619 filp_close_sync+0x6e/0xa0 fs/open.c:1897 close_files fs/file.c:572 [inline] put_files_struct+0x230/0x3c0 fs/file.c:584 do_exit+0x6f0/0x2360 kernel/exit.c:977 do_group_exit+0x22d/0x2f0 kernel/exit.c:1123 get_signal+0x1216/0x12c0 kernel/signal.c:3112 arch_do_signal_or_restart+0xbb/0x860 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:66 [inline] exit_to_user_mode_loop kernel/entry/common.c:101 [inline] __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] irqentry_exit_to_user_mode_prepare include/linux/irq-entry-common.h:244 [inline] irqentry_exit_to_user_mode include/linux/irq-entry-common.h:315 [inline] irqentry_exit+0x348/0x9b0 kernel/entry/common.c:152 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595 The buggy address belongs to the object at ffff888053e39c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 88 bytes inside of freed 512-byte region [ffff888053e39c00, ffff888053e39e00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x53e38 head: order:2 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 ffff88813ff28c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88813ff28c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 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 5883, tgid 5883 (udevd), ts 86346338784 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1856 prep_new_page mm/page_alloc.c:1864 [inline] get_page_from_freelist+0x220f/0x2280 mm/page_alloc.c:3935 __alloc_frozen_pages_noprof+0x1fe/0x410 mm/page_alloc.c:5459 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab+0x7d/0x5e0 mm/slub.c:3499 new_slab mm/slub.c:3550 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7539 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __kmalloc_cache_noprof+0x396/0x600 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] kernfs_fop_open+0x38c/0xd20 fs/kernfs/file.c:648 do_dentry_open+0x80e/0x1360 fs/open.c:1000 vfs_open_consume+0x4a/0x350 fs/open.c:1131 do_open fs/namei.c:4845 [inline] path_openat+0x16fc/0x20f0 fs/namei.c:5010 do_file_open+0x23e/0x4a0 fs/namei.c:5039 do_sys_openat2+0x115/0x200 fs/open.c:1442 do_sys_open fs/open.c:1448 [inline] __do_sys_openat fs/open.c:1788 [inline] __se_sys_openat fs/open.c:1783 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1783 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 12 tgid 12 ts 85666773251 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1403 [inline] __free_pages_ok+0xb6d/0xc60 mm/page_alloc.c:1581 free_one kernel/bpf/memalloc.c:267 [inline] free_all kernel/bpf/memalloc.c:278 [inline] drain_mem_cache+0x643/0x8e0 kernel/bpf/memalloc.c:673 bpf_mem_alloc_destroy+0x142/0x550 kernel/bpf/memalloc.c:791 trie_free+0x134/0x160 kernel/bpf/lpm_trie.c:652 bpf_map_free+0x19d/0x3f0 kernel/bpf/syscall.c:906 process_one_work kernel/workqueue.c:3495 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888053e39b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888053e39b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888053e39c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888053e39c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888053e39d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================