================================================================== BUG: KASAN: invalid-free in f_uac2_opts_p_srate_store+0x224/0x2b0 drivers/usb/gadget/function/f_uac2.c:2087 Free of addr ffff888105b9a18c by task syz-executor395/312 CPU: 0 UID: 0 PID: 312 Comm: syz-executor395 Not tainted syzkaller #0 0b31bef96cff8e44f9e14c4f768eb06c85e3b290 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:94 dump_stack_lvl+0x140/0x1c0 lib/dump_stack.c:120 print_address_description+0x71/0x210 mm/kasan/report.c:377 print_report+0x4a/0x70 mm/kasan/report.c:481 kasan_report_invalid_free+0x11e/0x160 mm/kasan/report.c:556 check_slab_allocation+0xdf/0xf0 include/linux/page-flags.h:-1 __kasan_slab_pre_free+0x36/0x50 mm/kasan/common.c:257 kasan_slab_pre_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:2390 [inline] slab_free mm/slub.c:4714 [inline] kfree+0xf8/0x440 mm/slub.c:4875 f_uac2_opts_p_srate_store+0x224/0x2b0 drivers/usb/gadget/function/f_uac2.c:2087 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x32f/0x490 fs/configfs/file.c:229 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x762/0xfd0 fs/read_write.c:684 ksys_write+0x145/0x260 fs/read_write.c:737 __do_sys_write fs/read_write.c:749 [inline] __se_sys_write fs/read_write.c:746 [inline] __x64_sys_write+0x7f/0x90 fs/read_write.c:746 x64_sys_call+0x271c/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:2 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f780dc67cb9 Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 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 d8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd1cdbf6a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000200000000000 RCX: 00007f780dc67cb9 RDX: 0000000000000101 RSI: 0000200000000d40 RDI: 0000000000000003 RBP: 0000000000000001 R08: 0000000000000000 R09: 00007ffd1cdbf7d8 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd1cdbf7c8 R13: 0000000000000002 R14: 00007f780dcf8ca0 R15: 0000000000000002 Allocated by task 312: kasan_save_stack mm/kasan/common.c:49 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:70 kasan_save_alloc_info+0x3a/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x96/0xb0 mm/kasan/common.c:396 kasan_kmalloc include/linux/kasan.h:261 [inline] __do_kmalloc_node mm/slub.c:4395 [inline] __kmalloc_node_track_caller_noprof+0x24e/0x4f0 mm/slub.c:4414 kstrdup+0x4d/0x130 mm/util.c:70 f_uac2_opts_p_srate_store+0x11e/0x2b0 drivers/usb/gadget/function/f_uac2.c:2087 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x32f/0x490 fs/configfs/file.c:229 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x762/0xfd0 fs/read_write.c:684 ksys_write+0x145/0x260 fs/read_write.c:737 __do_sys_write fs/read_write.c:749 [inline] __se_sys_write fs/read_write.c:746 [inline] __x64_sys_write+0x7f/0x90 fs/read_write.c:746 x64_sys_call+0x271c/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:2 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 entry_SYSCALL_64_after_hwframe+0x76/0x7e The buggy address belongs to the object at ffff888105b9a180 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 12 bytes inside of 18-byte region [ffff888105b9a180, ffff888105b9a192) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105b9a flags: 0x4000000000000000(zone=1) page_type: f5(slab) raw: 4000000000000000 ffff888100041780 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 312, tgid 312 (syz-executor395), ts 21691010635, free_ts 17641294812 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook+0x37d/0x3b0 mm/page_alloc.c:1863 prep_new_page+0x2d/0x180 mm/page_alloc.c:1871 get_page_from_freelist+0x4aea/0x4ba0 mm/page_alloc.c:3948 __alloc_pages_noprof+0x35a/0x7e0 mm/page_alloc.c:5315 alloc_slab_page+0x6b/0x1e0 mm/slub.c:-1 allocate_slab+0x69/0x430 mm/slub.c:2687 new_slab mm/slub.c:2741 [inline] ___slab_alloc+0x591/0x8c0 mm/slub.c:3934 __slab_alloc mm/slub.c:4025 [inline] __slab_alloc_node mm/slub.c:4078 [inline] slab_alloc_node mm/slub.c:4239 [inline] __do_kmalloc_node mm/slub.c:4394 [inline] __kmalloc_noprof+0x2fc/0x510 mm/slub.c:4407 kmalloc_noprof include/linux/slab.h:885 [inline] context_struct_to_string+0x45c/0xa10 security/selinux/ss/services.c:1249 sidtab_entry_to_string security/selinux/ss/services.c:1279 [inline] security_sid_to_context_core+0x340/0x5d0 security/selinux/ss/services.c:1377 security_sid_to_context+0x2e/0x50 security/selinux/ss/services.c:1398 avc_audit_post_callback+0x1a8/0x790 security/selinux/avc.c:712 common_lsm_audit+0x14b6/0x18b0 security/lsm_audit.c:461 slow_avc_audit+0x19f/0x220 security/selinux/avc.c:781 avc_audit security/selinux/include/avc.h:127 [inline] avc_has_perm+0x1ec/0x240 security/selinux/avc.c:1199 superblock_has_perm security/selinux/hooks.c:1967 [inline] selinux_sb_kern_mount+0x173/0x200 security/selinux/hooks.c:2760 page last free pid 33 tgid 33 stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1390 [inline] free_unref_page+0xbb8/0xf70 mm/page_alloc.c:2876 __free_pages+0x6b/0x3b0 mm/page_alloc.c:5402 pagetable_free include/linux/mm.h:3084 [inline] pagetable_dtor_free include/linux/mm.h:3174 [inline] __tlb_remove_table include/asm-generic/tlb.h:217 [inline] __tlb_remove_table_free mm/mmu_gather.c:228 [inline] tlb_remove_table_rcu+0x2b2/0x3d0 mm/mmu_gather.c:283 rcu_do_batch+0x56a/0xcb0 kernel/rcu/tree.c:2575 nocb_cb_wait kernel/rcu/tree_nocb.h:923 [inline] rcu_nocb_cb_kthread+0x533/0xb60 kernel/rcu/tree_nocb.h:957 kthread+0x2c7/0x360 kernel/kthread.c:389 ret_from_fork+0x67/0xa0 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888105b9a080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888105b9a100: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc >ffff888105b9a180: 00 00 02 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888105b9a200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888105b9a280: fc fc fc fc fc fc fc fc fa fb fb fb fc fc fc fc ================================================================== Disabling lock debugging due to kern