R13: 00007fd7a4a26038 R14: 00007fd7a4a25fa0 R15: 00007ffe057ff0e8 ================================================================== BUG: KASAN: double-free in gadgets_make+0x8a4/0xa50 drivers/usb/gadget/configfs.c:2063 Free of addr ffff88810fb69680 by task syz.0.1/318 CPU: 0 UID: 0 PID: 318 Comm: syz.0.1 Not tainted syzkaller #0 060dd26fc2c3b95caa7774ac3fc7b9d3ed7adcae 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 gadgets_make+0x8a4/0xa50 drivers/usb/gadget/configfs.c:2063 configfs_mkdir+0x526/0xb70 fs/configfs/dir.c:1339 vfs_mkdir+0x591/0x810 fs/namei.c:4265 do_mkdirat+0x240/0x530 fs/namei.c:4288 __do_sys_mkdirat fs/namei.c:4303 [inline] __se_sys_mkdirat fs/namei.c:4301 [inline] __x64_sys_mkdirat+0x8b/0xa0 fs/namei.c:4301 x64_sys_call+0x2ba8/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:259 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:0x7fd7a47a9559 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:00007fd7a55fd028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fd7a4a25fa0 RCX: 00007fd7a47a9559 RDX: 00000000000001ff RSI: 00002000000000c0 RDI: ffffffffffffff9c RBP: 00007fd7a4838136 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd7a4a26038 R14: 00007fd7a4a25fa0 R15: 00007ffe057ff0e8 Allocated by task 318: 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 kvasprintf+0xf1/0x260 lib/kasprintf.c:25 kasprintf+0xe3/0x140 lib/kasprintf.c:59 gadgets_make+0x786/0xa50 drivers/usb/gadget/configfs.c:2044 configfs_mkdir+0x526/0xb70 fs/configfs/dir.c:1339 vfs_mkdir+0x591/0x810 fs/namei.c:4265 do_mkdirat+0x240/0x530 fs/namei.c:4288 __do_sys_mkdirat fs/namei.c:4303 [inline] __se_sys_mkdirat fs/namei.c:4301 [inline] __x64_sys_mkdirat+0x8b/0xa0 fs/namei.c:4301 x64_sys_call+0x2ba8/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:259 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 Freed by task 318: kasan_save_stack mm/kasan/common.c:49 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:70 kasan_save_free_info+0x44/0x50 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:249 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:266 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2445 [inline] slab_free mm/slub.c:4716 [inline] kfree+0x158/0x440 mm/slub.c:4877 gadgets_make+0x87c/0xa50 drivers/usb/gadget/configfs.c:2061 configfs_mkdir+0x526/0xb70 fs/configfs/dir.c:1339 vfs_mkdir+0x591/0x810 fs/namei.c:4265 do_mkdirat+0x240/0x530 fs/namei.c:4288 __do_sys_mkdirat fs/namei.c:4303 [inline] __se_sys_mkdirat fs/namei.c:4301 [inline] __x64_sys_mkdirat+0x8b/0xa0 fs/namei.c:4301 x64_sys_call+0x2ba8/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:259 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 ffff88810fb69680 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff88810fb69680, ffff88810fb696a0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10fb69 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 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 298, tgid 298 (syz-executor), ts 24416203743, free_ts 24416115659 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] __kmalloc_cache_noprof+0x2cd/0x470 mm/slub.c:4423 kmalloc_noprof include/linux/slab.h:882 [inline] kzalloc_noprof include/linux/slab.h:1117 [inline] ref_tracker_alloc+0x181/0x5b0 lib/ref_tracker.c:203 __netns_tracker_alloc include/net/net_namespace.h:348 [inline] netns_tracker_alloc include/net/net_namespace.h:357 [inline] get_net_track include/net/net_namespace.h:374 [inline] sk_alloc+0x1d0/0x590 net/core/sock.c:2251 inet_create+0x5b7/0x1010 net/ipv4/af_inet.c:327 __sock_create+0x3a5/0x810 net/socket.c:1559 sock_create net/socket.c:1617 [inline] __sys_socket_create net/socket.c:1654 [inline] __sys_socket+0xe1/0x1c0 net/socket.c:1701 __do_sys_socket net/socket.c:1715 [inline] __se_sys_socket net/socket.c:1713 [inline] __x64_sys_socket+0x7e/0x90 net/socket.c:1713 x64_sys_call+0x2608/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:42 do_syscall_x64 arch/x86/entry/common.c:47 [inline] do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78 page last free pid 298 tgid 298 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 vfree+0x3ea/0x5b0 mm/vmalloc.c:3410 copy_entries_to_user net/ipv4/netfilter/arp_tables.c:723 [inline] get_entries net/ipv4/netfilter/arp_tables.c:877 [inline] do_arpt_get_ctl+0xdd3/0x10e0 net/ipv4/netfilter/arp_tables.c:1470 nf_getsockopt+0x288/0x2b0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x15b/0x200 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x103/0x130 net/ipv4/tcp.c:4709 sock_common_getsockopt+0xaf/0xd0 net/core/sock.c:3847 do_sock_getsockopt+0x3a1/0x6c0 net/socket.c:2375 __sys_getsockopt net/socket.c:2404 [inline] __do_sys_getsockopt net/socket.c:2411 [inline] __se_sys_getsockopt net/socket.c:2408 [inline] __x64_sys_getsockopt+0x1aa/0x250 net/socket.c:2408 x64_sys_call+0x10db/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:56 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 Memory state around the buggy address: ffff88810fb69580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88810fb69600: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810fb69680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ^ ffff88810fb69700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88810fb69780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================