================================================================== BUG: KASAN: invalid-free in f_uac2_opts_c_srate_store+0x224/0x2b0 drivers/usb/gadget/function/f_uac2.c:2091 Free of addr ffff8881223be814 by task syz.2.399/1773 CPU: 0 UID: 0 PID: 1773 Comm: syz.2.399 Not tainted syzkaller #0 d9b98407f8a28ec19c03d96985e3e265ac4f36c6 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/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:4716 [inline] kfree+0xf8/0x440 mm/slub.c:4877 f_uac2_opts_c_srate_store+0x224/0x2b0 drivers/usb/gadget/function/f_uac2.c:2091 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x32c/0x490 fs/configfs/file.c:229 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x765/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:0x7f31cf3a9a99 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:00007f31d0217028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f31cf635fa0 RCX: 00007f31cf3a9a99 RDX: 0000000000001003 RSI: 0000200000000300 RDI: 0000000000000003 RBP: 00007f31cf43918b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f31cf636038 R14: 00007f31cf635fa0 R15: 00007ffff4cb0478 Allocated by task 1773: 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:4397 [inline] __kmalloc_node_track_caller_noprof+0x24e/0x4f0 mm/slub.c:4416 kstrdup+0x4d/0x130 mm/util.c:70 f_uac2_opts_c_srate_store+0x11e/0x2b0 drivers/usb/gadget/function/f_uac2.c:2091 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x32c/0x490 fs/configfs/file.c:229 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x765/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 ffff8881223be800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 20 bytes inside of 363-byte region [ffff8881223be800, ffff8881223be96b) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1223bc head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4000000000000040(head|zone=1) page_type: f5(slab) raw: 4000000000000040 ffff888100041c80 ffffea000470e300 dead000000000002 raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 4000000000000040 ffff888100041c80 ffffea000470e300 dead000000000002 head: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 4000000000000002 ffffea000488ef01 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 100, tgid 100 (klogd), ts 40690005338, free_ts 38520051758 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook+0x37d/0x3b0 mm/page_alloc.c:1864 prep_new_page+0x2d/0x180 mm/page_alloc.c:1872 get_page_from_freelist+0x4aea/0x4ba0 mm/page_alloc.c:3949 __alloc_pages_noprof+0x35a/0x7e0 mm/page_alloc.c:5316 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:4241 [inline] __do_kmalloc_node mm/slub.c:4396 [inline] __kmalloc_node_track_caller_noprof+0x2e3/0x4f0 mm/slub.c:4416 kmalloc_reserve+0x144/0x4f0 net/core/skbuff.c:618 __alloc_skb+0x13f/0x360 net/core/skbuff.c:687 alloc_skb include/linux/skbuff.h:1363 [inline] alloc_skb_with_frags+0xd0/0x8b0 net/core/skbuff.c:6658 sock_alloc_send_pskb+0x883/0x9a0 net/core/sock.c:2932 unix_dgram_sendmsg+0x63a/0x1a90 net/unix/af_unix.c:2040 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg net/socket.c:727 [inline] __sys_sendto+0x666/0x6e0 net/socket.c:2198 __do_sys_sendto net/socket.c:2205 [inline] __se_sys_sendto net/socket.c:2201 [inline] __x64_sys_sendto+0xe9/0x100 net/socket.c:2201 x64_sys_call+0x2c2c/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:45 page last free pid 66 tgid 66 stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1391 [inline] free_unref_page+0xb99/0xf50 mm/page_alloc.c:2877 __free_pages+0x6b/0x3b0 mm/page_alloc.c:5403 free_pages+0x86/0x90 mm/page_alloc.c:5416 kasan_depopulate_vmalloc_pte+0x79/0xa0 mm/kasan/shadow.c:408 apply_to_pte_range mm/memory.c:2916 [inline] apply_to_pmd_range mm/memory.c:2960 [inline] apply_to_pud_range mm/memory.c:2996 [inline] apply_to_p4d_range mm/memory.c:3032 [inline] __apply_to_page_range+0x7bf/0xd00 mm/memory.c:3068 apply_to_existing_page_range+0x3c/0x50 mm/memory.c:3101 kasan_release_vmalloc+0xa6/0xd0 mm/kasan/shadow.c:529 kasan_release_vmalloc_node mm/vmalloc.c:2217 [inline] purge_vmap_node+0x245/0x8b0 mm/vmalloc.c:2239 __purge_vmap_area_lazy+0x627/0x8e0 mm/vmalloc.c:2330 drain_vmap_area_work+0x29/0x50 mm/vmalloc.c:2364 process_one_work kernel/workqueue.c:3273 [inline] process_scheduled_works+0x7f7/0x1060 kernel/workqueue.c:3354 worker_thread+0xc99/0x13f0 kernel/workqueue.c:3435 kthread+0x2c7/0x360 kernel/kthread.c:389 ret_from_fork+0x64/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: ffff8881223be700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881223be780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881223be800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8881223be880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881223be900: 00 00 00 00 00 00 00 00 00 00 00 00 00 03 fc fc ==================================================================