================================================================== BUG: KASAN: use-after-free in kobject_get+0x113/0x120 lib/kobject.c:663 Read of size 1 at addr ffff88812815583c by task syz.7.219/1156 CPU: 0 PID: 1156 Comm: syz.7.219 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x100/0x140 mm/kasan/report.c:452 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 kobject_get+0x113/0x120 lib/kobject.c:663 get_device drivers/base/core.c:3361 [inline] device_add+0x331/0xc00 drivers/base/core.c:3191 device_create_groups_vargs drivers/base/core.c:3960 [inline] device_create+0x26c/0x300 drivers/base/core.c:4002 create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31 create_alsa_device drivers/usb/gadget/function/f_midi.c:1262 [inline] f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1303 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline] usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44 function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636 configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1354 vfs_mkdir+0x42c/0x600 fs/namei.c:3798 do_mkdirat+0x14c/0x340 fs/namei.c:3820 __do_sys_mkdirat fs/namei.c:3831 [inline] __se_sys_mkdirat fs/namei.c:3829 [inline] __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3829 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fad92ab00d9 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:00007fad91509028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fad92d37fa0 RCX: 00007fad92ab00d9 RDX: 00000000000001ff RSI: 0000200000000100 RDI: ffffffffffffff9c RBP: 00007fad92b47024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fad92d38038 R14: 00007fad92d37fa0 R15: 00007ffcd8630248 Allocated by task 320: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x179/0x2e0 mm/slub.c:2979 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:667 [inline] device_create_groups_vargs drivers/base/core.c:3942 [inline] device_create+0x13a/0x300 drivers/base/core.c:4002 android_device_create drivers/usb/gadget/configfs.c:1789 [inline] gadgets_make+0x816/0xa70 drivers/usb/gadget/configfs.c:1886 configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1354 vfs_mkdir+0x42c/0x600 fs/namei.c:3798 do_mkdirat+0x14c/0x340 fs/namei.c:3820 __do_sys_mkdirat fs/namei.c:3831 [inline] __se_sys_mkdirat fs/namei.c:3829 [inline] __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3829 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 1091: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1600 [inline] slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626 slab_free mm/slub.c:3208 [inline] kfree+0xc0/0x270 mm/slub.c:4196 device_create_release+0x15/0x20 drivers/base/core.c:3927 device_release+0x96/0x1c0 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x18a/0x270 lib/kobject.c:761 put_device drivers/base/core.c:3373 [inline] device_unregister drivers/base/core.c:3498 [inline] device_destroy+0xb4/0xf0 drivers/base/core.c:4068 android_device_destroy drivers/usb/gadget/configfs.c:1821 [inline] gadgets_drop+0xa0/0xd0 drivers/usb/gadget/configfs.c:1902 client_drop_item fs/configfs/dir.c:959 [inline] configfs_rmdir+0x871/0x960 fs/configfs/dir.c:1576 vfs_rmdir+0x1ab/0x3c0 fs/namei.c:3860 do_rmdir+0x232/0x630 fs/namei.c:3920 __do_sys_rmdir fs/namei.c:3938 [inline] __se_sys_rmdir fs/namei.c:3936 [inline] __x64_sys_rmdir+0x49/0x50 fs/namei.c:3936 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff888128155800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 60 bytes inside of 1024-byte region [ffff888128155800, ffff888128155c00) The buggy address belongs to the page: page:ffffea0004a05400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x128150 head:ffffea0004a05400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea0004480c00 0000000500000005 ffff888100042f00 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 315, ts 25513671133, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x176/0x190 mm/page_alloc.c:2462 get_page_from_freelist+0x225f/0x23f0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x29a/0x640 mm/page_alloc.c:5384 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1813 [inline] new_slab+0x84/0x3f0 mm/slub.c:1874 new_slab_objects mm/slub.c:2632 [inline] ___slab_alloc+0x2f8/0x4c0 mm/slub.c:2796 __slab_alloc+0x63/0xa0 mm/slub.c:2836 slab_alloc_node mm/slub.c:2918 [inline] slab_alloc mm/slub.c:2960 [inline] __kmalloc_track_caller+0x1e4/0x310 mm/slub.c:4541 __kmalloc_reserve net/core/skbuff.c:144 [inline] __alloc_skb+0xdc/0x520 net/core/skbuff.c:212 alloc_skb include/linux/skbuff.h:1126 [inline] nlmsg_new include/net/netlink.h:953 [inline] xfrm_notify_sa net/xfrm/xfrm_user.c:2974 [inline] xfrm_send_state_notify+0x6bf/0x1d30 net/xfrm/xfrm_user.c:3025 km_state_notify+0x68/0xc0 net/xfrm/xfrm_state.c:2190 xfrm_add_sa+0x23a2/0x2e90 net/xfrm/xfrm_user.c:722 xfrm_user_rcv_msg+0x54d/0x7e0 net/xfrm/xfrm_user.c:2789 netlink_rcv_skb+0x1e9/0x430 net/netlink/af_netlink.c:2508 xfrm_netlink_rcv+0x72/0x90 net/xfrm/xfrm_user.c:2811 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x86c/0xa30 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x949/0xb70 net/netlink/af_netlink.c:1919 page_owner free stack trace missing Memory state around the buggy address: ffff888128155700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888128155780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888128155800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888128155880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888128155900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 1156 at lib/refcount.c:25 refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25 Modules linked in: CPU: 1 PID: 1156 Comm: syz.7.219 Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 RIP: 0010:refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25 Code: 04 01 48 c7 c7 e0 4a 40 85 e8 b8 d3 3a 02 0f 0b eb df e8 0f 89 26 ff c6 05 ac 76 82 04 01 48 c7 c7 20 4a 40 85 e8 9c d3 3a 02 <0f> 0b eb c3 e8 f3 88 26 ff c6 05 91 76 82 04 01 48 c7 c7 80 4a 40 RSP: 0018:ffffc90000d37950 EFLAGS: 00010246 RAX: f5c717325d3e9d00 RBX: 0000000000000002 RCX: 0000000000080000 RDX: ffffc900068fc000 RSI: 000000000005ed81 RDI: 000000000005ed82 RBP: ffffc90000d37960 R08: ffffc90000d372e7 R09: fffff520001a6e90 R10: dffffc0000000000 R11: fffff520001a6e5d R12: 0000000000000000 R13: ffff8881260ae068 R14: 0000000000000002 R15: 0000000000000000 FS: 00007fad915096c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fad914c7d58 CR3: 00000001268ab000 CR4: 00000000003526a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __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] kobject_get+0xfb/0x120 lib/kobject.c:667 get_device drivers/base/core.c:3361 [inline] device_add+0x331/0xc00 drivers/base/core.c:3191 device_create_groups_vargs drivers/base/core.c:3960 [inline] device_create+0x26c/0x300 drivers/base/core.c:4002 create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31 create_alsa_device drivers/usb/gadget/function/f_midi.c:1262 [inline] f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1303 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline] usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44 function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636 configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1354 vfs_mkdir+0x42c/0x600 fs/namei.c:3798 do_mkdirat+0x14c/0x340 fs/namei.c:3820 __do_sys_mkdirat fs/namei.c:3831 [inline] __se_sys_mkdirat fs/namei.c:3829 [inline] __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3829 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fad92ab00d9 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:00007fad91509028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fad92d37fa0 RCX: 00007fad92ab00d9 RDX: 00000000000001ff RSI: 0000200000000100 RDI: ffffffffffffff9c RBP: 00007fad92b47024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fad92d38038 R14: 00007fad92d37fa0 R15: 00007ffcd8630248 ---[ end trace 9ecfc58ec36fda81 ]--- ------------[ cut here ]------------ refcount_t: saturated; leaking memory. WARNING: CPU: 1 PID: 1156 at lib/refcount.c:22 refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22 Modules linked in: CPU: 1 PID: 1156 Comm: syz.7.219 Tainted: G B W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 RIP: 0010:refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22 Code: 04 01 48 c7 c7 a0 49 40 85 e8 64 d3 3a 02 0f 0b eb 8b e8 bb 88 26 ff c6 05 57 76 82 04 01 48 c7 c7 a0 49 40 85 e8 48 d3 3a 02 <0f> 0b e9 6c ff ff ff e8 9c 88 26 ff c6 05 3c 76 82 04 01 48 c7 c7 RSP: 0018:ffffc90000d37818 EFLAGS: 00010246 RAX: f5c717325d3e9d00 RBX: 0000000000000001 RCX: 0000000000080000 RDX: ffffc900068fc000 RSI: 000000000007ffff RDI: 0000000000080000 RBP: ffffc90000d37828 R08: ffffc90000d371a7 R09: fffff520001a6e68 R10: dffffc0000000000 R11: fffff520001a6e35 R12: 00000000c0000000 R13: ffff8881260ae018 R14: 0000000000000001 R15: ffff888128155838 FS: 00007fad915096c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fad914c7d58 CR3: 00000001268ab000 CR4: 00000000003526a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __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] kobject_get lib/kobject.c:667 [inline] kobject_add_internal+0xc44/0xde0 lib/kobject.c:248 kobject_add_varg lib/kobject.c:398 [inline] kobject_add+0x165/0x230 lib/kobject.c:450 device_add+0x3d8/0xc00 drivers/base/core.c:3206 device_create_groups_vargs drivers/base/core.c:3960 [inline] device_create+0x26c/0x300 drivers/base/core.c:4002 create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31 create_alsa_device drivers/usb/gadget/function/f_midi.c:1262 [inline] f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1303 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline] usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44 function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636 configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1354 vfs_mkdir+0x42c/0x600 fs/namei.c:3798 do_mkdirat+0x14c/0x340 fs/namei.c:3820 __do_sys_mkdirat fs/namei.c:3831 [inline] __se_sys_mkdirat fs/namei.c:3829 [inline] __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3829 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fad92ab00d9 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:00007fad91509028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fad92d37fa0 RCX: 00007fad92ab00d9 RDX: 00000000000001ff RSI: 0000200000000100 RDI: ffffffffffffff9c RBP: 00007fad92b47024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fad92d38038 R14: 00007fad92d37fa0 R15: 00007ffcd8630248 ---[ end trace 9ecfc58ec36fda82 ]--- ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 1156 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28 Modules linked in: CPU: 0 PID: 1156 Comm: syz.7.219 Tainted: G B W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28 Code: 04 01 48 c7 c7 20 4a 40 85 e8 9c d3 3a 02 0f 0b eb c3 e8 f3 88 26 ff c6 05 91 76 82 04 01 48 c7 c7 80 4a 40 85 e8 80 d3 3a 02 <0f> 0b eb a7 e8 d7 88 26 ff c6 05 72 76 82 04 01 48 c7 c7 a0 49 40 RSP: 0018:ffffc90000d377e0 EFLAGS: 00010246 RAX: f5c717325d3e9d00 RBX: 0000000000000003 RCX: 0000000000080000 RDX: ffffc900068fc000 RSI: 000000000007ffff RDI: 0000000000080000 RBP: ffffc90000d377f0 R08: ffff8881f7027453 R09: 1ffff1103ee04e8a R10: dffffc0000000000 R11: ffffed103ee04e8b R12: 00000000c0000000 R13: ffff88812815583c R14: 0000000000000003 R15: ffff888128155838 FS: 00007fad915096c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055558b92b948 CR3: 00000001268ab000 CR4: 00000000003526b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_sub_and_test include/linux/refcount.h:283 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] kref_put include/linux/kref.h:64 [inline] kobject_put+0x231/0x270 lib/kobject.c:761 kobject_add_internal+0xb52/0xde0 lib/kobject.c:266 kobject_add_varg lib/kobject.c:398 [inline] kobject_add+0x165/0x230 lib/kobject.c:450 device_add+0x3d8/0xc00 drivers/base/core.c:3206 device_create_groups_vargs drivers/base/core.c:3960 [inline] device_create+0x26c/0x300 drivers/base/core.c:4002 create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31 create_alsa_device drivers/usb/gadget/function/f_midi.c:1262 [inline] f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1303 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline] usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44 function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636 configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1354 vfs_mkdir+0x42c/0x600 fs/namei.c:3798 do_mkdirat+0x14c/0x340 fs/namei.c:3820 __do_sys_mkdirat fs/namei.c:3831 [inline] __se_sys_mkdirat fs/namei.c:3829 [inline] __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3829 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fad92ab00d9 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:00007fad91509028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fad92d37fa0 RCX: 00007fad92ab00d9 RDX: 00000000000001ff RSI: 0000200000000100 RDI: ffffffffffffff9c RBP: 00007fad92b47024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fad92d38038 R14: 00007fad92d37fa0 R15: 00007ffcd8630248 ---[ end trace 9ecfc58ec36fda83 ]--- kobject_add_internal failed for f_midi (error: -2 parent: )