================================================================== BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:86 [inline] BUG: KASAN: use-after-free in atomic_set include/linux/atomic/atomic-instrumented.h:41 [inline] BUG: KASAN: use-after-free in refcount_set include/linux/refcount.h:136 [inline] BUG: KASAN: use-after-free in refcount_warn_saturate+0x1a/0x1a0 lib/refcount.c:15 Write of size 4 at addr ffff88805836e41c by task syz.2.1783/6218 CPU: 1 PID: 6218 Comm: syz.2.1783 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x235/0x290 mm/kasan/generic.c:189 instrument_atomic_write include/linux/instrumented.h:86 [inline] atomic_set include/linux/atomic/atomic-instrumented.h:41 [inline] refcount_set include/linux/refcount.h:136 [inline] refcount_warn_saturate+0x1a/0x1a0 lib/refcount.c:15 __refcount_add include/linux/refcount.h:-1 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] kref_get include/linux/kref.h:45 [inline] config_item_get+0x7f/0x90 fs/configfs/item.c:104 configfs_get_config_item fs/configfs/configfs_internal.h:128 [inline] get_target fs/configfs/symlink.c:125 [inline] configfs_symlink+0x463/0x13b0 fs/configfs/symlink.c:191 vfs_symlink+0x245/0x3d0 fs/namei.c:4437 do_symlinkat+0x1ab/0x6b0 fs/namei.c:4466 __do_sys_symlinkat fs/namei.c:4483 [inline] __se_sys_symlinkat fs/namei.c:4480 [inline] __x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4480 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fcf89b58e99 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:00007ffe927ae948 EFLAGS: 00000246 ORIG_RAX: 000000000000010a RAX: ffffffffffffffda RBX: 00007fcf89de0fa0 RCX: 00007fcf89b58e99 RDX: 0000200000000340 RSI: ffffffffffffff9c RDI: 0000200000000300 RBP: 00007fcf89beeeaf R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fcf89de0fac R14: 00007fcf89de0fa0 R15: 00007fcf89de0fa0 Allocated by task 6219: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:607 [inline] kzalloc include/linux/slab.h:738 [inline] afunc_alloc_inst+0x48/0x560 drivers/usb/gadget/function/f_uac2.c:1917 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline] usb_get_function_instance+0xd9/0x2e0 drivers/usb/gadget/functions.c:44 function_make+0x118/0x350 drivers/usb/gadget/configfs.c:610 configfs_mkdir+0x511/0x9e0 fs/configfs/dir.c:1360 vfs_mkdir+0x386/0x570 fs/namei.c:4073 do_mkdirat+0x1dd/0x5c0 fs/namei.c:4098 __do_sys_mkdirat fs/namei.c:4113 [inline] __se_sys_mkdirat fs/namei.c:4111 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4111 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 6217: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1710 [inline] slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736 slab_free mm/slub.c:3504 [inline] kfree+0xef/0x2a0 mm/slub.c:4564 usb_put_function_instance+0x81/0xa0 drivers/usb/gadget/functions.c:77 config_item_cleanup fs/configfs/item.c:128 [inline] config_item_release+0x133/0x290 fs/configfs/item.c:137 configfs_rmdir+0x8bd/0x980 fs/configfs/dir.c:1571 vfs_rmdir+0x19d/0x410 fs/namei.c:4157 do_rmdir+0x27f/0x710 fs/namei.c:4218 __do_sys_unlinkat fs/namei.c:4398 [inline] __se_sys_unlinkat fs/namei.c:4392 [inline] __x64_sys_unlinkat+0xc0/0xe0 fs/namei.c:4392 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88805836e400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 28 bytes inside of 512-byte region [ffff88805836e400, ffff88805836e600) The buggy address belongs to the page: page:ffffea000160db00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5836c head:ffffea000160db00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888016c41c80 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x1d2000(__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4308, ts 82968741314, free_ts 82968058114 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501 alloc_slab_page mm/slub.c:1780 [inline] allocate_slab mm/slub.c:1917 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1980 ___slab_alloc+0x807/0xdd0 mm/slub.c:3013 __slab_alloc mm/slub.c:3100 [inline] slab_alloc_node mm/slub.c:3191 [inline] __kmalloc_node_track_caller+0x13d/0x3a0 mm/slub.c:4963 kmalloc_reserve net/core/skbuff.c:356 [inline] __alloc_skb+0x22c/0x750 net/core/skbuff.c:427 alloc_skb include/linux/skbuff.h:1162 [inline] alloc_uevent_skb+0x7d/0x230 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast+0x17e/0x530 lib/kobject_uevent.c:412 kobject_uevent_env+0x550/0x890 lib/kobject_uevent.c:608 __kobject_del+0xd1/0x2e0 lib/kobject.c:625 kobject_cleanup lib/kobject.c:704 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x450 lib/kobject.c:761 netdev_queue_update_kobjects+0x382/0x3e0 net/core/net-sysfs.c:1726 remove_queue_kobjects net/core/net-sysfs.c:1823 [inline] netdev_unregister_kobject+0x104/0x250 net/core/net-sysfs.c:1976 unregister_netdevice_many+0x1530/0x1a40 net/core/dev.c:11187 unregister_netdevice_queue+0x2e1/0x320 net/core/dev.c:11093 unregister_netdevice include/linux/netdevice.h:3029 [inline] lapbeth_free_device drivers/net/wan/lapbether.c:437 [inline] lapbeth_device_event+0x33e/0x380 drivers/net/wan/lapbether.c:471 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396 stack_depot_save+0x42f/0x460 lib/stackdepot.c:335 kasan_save_stack mm/kasan/common.c:40 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xc6/0xe0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:607 [inline] kzalloc include/linux/slab.h:738 [inline] kobject_uevent_env+0x275/0x890 lib/kobject_uevent.c:539 __kobject_del+0xd1/0x2e0 lib/kobject.c:625 kobject_cleanup lib/kobject.c:704 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x450 lib/kobject.c:761 net_rx_queue_update_kobjects+0x43b/0x4b0 net/core/net-sysfs.c:1124 remove_queue_kobjects net/core/net-sysfs.c:1822 [inline] netdev_unregister_kobject+0xf8/0x250 net/core/net-sysfs.c:1976 unregister_netdevice_many+0x1530/0x1a40 net/core/dev.c:11187 unregister_netdevice_queue+0x2e1/0x320 net/core/dev.c:11093 unregister_netdevice include/linux/netdevice.h:3029 [inline] lapbeth_free_device drivers/net/wan/lapbether.c:437 [inline] lapbeth_device_event+0x33e/0x380 drivers/net/wan/lapbether.c:471 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391 call_netdevice_notifiers_extack net/core/dev.c:2074 [inline] call_netdevice_notifiers net/core/dev.c:2088 [inline] unregister_netdevice_many+0x109b/0x1a40 net/core/dev.c:11160 unregister_netdevice_queue+0x2e1/0x320 net/core/dev.c:11093 unregister_netdevice include/linux/netdevice.h:3029 [inline] nsim_destroy+0x49/0x150 drivers/net/netdevsim/netdev.c:382 Memory state around the buggy address: ffff88805836e300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805836e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805836e400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805836e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805836e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================