================================================================== BUG: KASAN: use-after-free in kobject_get+0x113/0x120 lib/kobject.c:663 Read of size 1 at addr ffff88811570983c by task syz.6.305/1786 CPU: 0 PID: 1786 Comm: syz.6.305 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x10f/0x150 mm/kasan/report.c:444 __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:3518 [inline] device_add+0x2f0/0xe90 drivers/base/core.c:3342 device_create_groups_vargs drivers/base/core.c:4118 [inline] device_create+0x26c/0x300 drivers/base/core.c:4160 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:642 configfs_mkdir+0x50a/0x9c0 fs/configfs/dir.c:1356 vfs_mkdir+0x38b/0x590 fs/namei.c:4073 do_mkdirat+0x174/0x4d0 fs/namei.c:4098 __do_sys_mkdirat fs/namei.c:4113 [inline] __se_sys_mkdirat fs/namei.c:4111 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111 x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259 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:0x7f3a7057d559 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:00007f3a6efd5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f3a70803fa0 RCX: 00007f3a7057d559 RDX: 0000000000000020 RSI: 0000200000000e80 RDI: ffffffffffffff9c RBP: 00007f3a70614b50 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f3a70804038 R14: 00007f3a70803fa0 R15: 00007ffe51d32cb8 Allocated by task 1584: 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:433 [inline] ____kasan_kmalloc mm/kasan/common.c:512 [inline] __kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] kmem_cache_alloc_trace+0x119/0x270 mm/slub.c:3274 kmalloc include/linux/slab.h:619 [inline] kzalloc include/linux/slab.h:750 [inline] usb_create_ep_devs+0x59/0x270 drivers/usb/core/endpoint.c:156 usb_new_device+0xb35/0x1720 drivers/usb/core/hub.c:2671 hub_port_connect drivers/usb/core/hub.c:5560 [inline] hub_port_connect_change drivers/usb/core/hub.c:5700 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x291b/0x43f0 drivers/usb/core/hub.c:5948 process_one_work+0x6c8/0xbb0 kernel/workqueue.c:2328 worker_thread+0xaa0/0x1250 kernel/workqueue.c:2475 kthread+0x3f5/0x4f0 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Freed by task 1584: 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:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754 slab_free mm/slub.c:3526 [inline] kfree+0xc4/0x270 mm/slub.c:4588 ep_device_release+0x19/0x20 drivers/usb/core/endpoint.c:141 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:3530 [inline] device_unregister+0x27/0x40 drivers/base/core.c:3656 usb_remove_ep_devs+0x50/0x80 drivers/usb/core/endpoint.c:188 usb_disconnect+0x54c/0x870 drivers/usb/core/hub.c:2312 hub_port_connect drivers/usb/core/hub.c:5399 [inline] hub_port_connect_change drivers/usb/core/hub.c:5700 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x19b0/0x43f0 drivers/usb/core/hub.c:5948 process_one_work+0x6c8/0xbb0 kernel/workqueue.c:2328 process_scheduled_works kernel/workqueue.c:2391 [inline] worker_thread+0xd4c/0x1250 kernel/workqueue.c:2477 kthread+0x3f5/0x4f0 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff888115709800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 60 bytes inside of 1024-byte region [ffff888115709800, ffff888115709c00) The buggy address belongs to the page: page:ffffea000455c200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x115708 head:ffffea000455c200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043080 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 109, ts 6596653888, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2610 prep_new_page+0x1c/0x110 mm/page_alloc.c:2616 get_page_from_freelist+0x2d42/0x2dd0 mm/page_alloc.c:4492 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5829 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1937 [inline] new_slab+0xa0/0x4d0 mm/slub.c:2000 ___slab_alloc+0x3ac/0x840 mm/slub.c:3033 __slab_alloc+0x49/0x90 mm/slub.c:3120 slab_alloc_node mm/slub.c:3211 [inline] slab_alloc mm/slub.c:3255 [inline] __kmalloc_track_caller+0x169/0x2c0 mm/slub.c:4954 kmalloc_reserve net/core/skbuff.c:357 [inline] __alloc_skb+0x210/0x730 net/core/skbuff.c:428 alloc_skb include/linux/skbuff.h:1183 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline] netlink_sendmsg+0x611/0xb80 net/netlink/af_netlink.c:1898 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x5be/0x8f0 net/socket.c:2436 ___sys_sendmsg+0x236/0x2e0 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg net/socket.c:2526 [inline] __x64_sys_sendmsg+0x201/0x2d0 net/socket.c:2526 x64_sys_call+0x4b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47 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 page_owner free stack trace missing Memory state around the buggy address: ffff888115709700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888115709780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888115709800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888115709880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888115709900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: saturated; leaking memory. WARNING: CPU: 0 PID: 1786 at lib/refcount.c:22 refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22 Modules linked in: CPU: 0 PID: 1786 Comm: syz.6.305 Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 RIP: 0010:refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22 Code: 04 01 48 c7 c7 80 57 63 85 e8 24 d0 5b 02 0f 0b eb 8b e8 db 58 19 ff c6 05 b8 c4 95 04 01 48 c7 c7 80 57 63 85 e8 08 d0 5b 02 <0f> 0b e9 6c ff ff ff e8 bc 58 19 ff c6 05 9d c4 95 04 01 48 c7 c7 RSP: 0018:ffffc900012079f8 EFLAGS: 00010246 RAX: 2af1ec8e7d84c500 RBX: 0000000000000001 RCX: 0000000000080000 RDX: ffffc9000635d000 RSI: 000000000007ffff RDI: 0000000000080000 RBP: ffffc90001207a08 R08: ffff8881f7027493 R09: 1ffff1103ee04e92 R10: dffffc0000000000 R11: ffffed103ee04e93 R12: 1ffff11025bb710e R13: dffffc0000000000 R14: 0000000000000001 R15: 0000000086a49700 FS: 00007f3a6efd56c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f03edc49000 CR3: 000000011e324000 CR4: 00000000003506b0 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:3518 [inline] device_add+0x2f0/0xe90 drivers/base/core.c:3342 device_create_groups_vargs drivers/base/core.c:4118 [inline] device_create+0x26c/0x300 drivers/base/core.c:4160 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:642 configfs_mkdir+0x50a/0x9c0 fs/configfs/dir.c:1356 vfs_mkdir+0x38b/0x590 fs/namei.c:4073 do_mkdirat+0x174/0x4d0 fs/namei.c:4098 __do_sys_mkdirat fs/namei.c:4113 [inline] __se_sys_mkdirat fs/namei.c:4111 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111 x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259 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:0x7f3a7057d559 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:00007f3a6efd5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f3a70803fa0 RCX: 00007f3a7057d559 RDX: 0000000000000020 RSI: 0000200000000e80 RDI: ffffffffffffff9c RBP: 00007f3a70614b50 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f3a70804038 R14: 00007f3a70803fa0 R15: 00007ffe51d32cb8 ---[ end trace b20080872744f818 ]--- general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027] CPU: 0 PID: 1786 Comm: syz.6.305 Tainted: G B W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 RIP: 0010:idr_alloc_cyclic+0xa3/0x5f0 lib/idr.c:121 Code: 01 01 01 01 4b 89 44 2e 08 43 c7 44 2e 10 f3 f3 f3 f3 e8 b0 f7 f9 fe 49 8d 4c 24 14 48 89 4c 24 28 48 c1 e9 03 48 89 4c 24 58 <42> 0f b6 04 29 84 c0 0f 85 39 04 00 00 45 8b 6c 24 14 31 ff 89 de RSP: 0018:ffffc900012074e0 EFLAGS: 00010203 RAX: ffffffff826fdf50 RBX: 0000000000000000 RCX: 0000000000000004 RDX: ffffc9000635d000 RSI: 000000000007ffff RDI: 0000000000080000 RBP: ffffc90001207630 R08: 0000000000000a20 R09: 0000000000000004 R10: dffffc0000000000 R11: fffff52000240eb8 R12: 0000000000000010 R13: dffffc0000000000 R14: 1ffff92000240ea8 R15: 0000000000000001 FS: 00007f3a6efd56c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f03edc49000 CR3: 000000011e324000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __kernfs_new_node+0x130/0x670 fs/kernfs/dir.c:599 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:669 kernfs_create_dir_ns+0x47/0x130 fs/kernfs/dir.c:1017 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x774/0xde0 lib/kobject.c:263 kobject_add_varg lib/kobject.c:398 [inline] kobject_add+0x165/0x230 lib/kobject.c:450 device_add+0x398/0xe90 drivers/base/core.c:3357 device_create_groups_vargs drivers/base/core.c:4118 [inline] device_create+0x26c/0x300 drivers/base/core.c:4160 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:642 configfs_mkdir+0x50a/0x9c0 fs/configfs/dir.c:1356 vfs_mkdir+0x38b/0x590 fs/namei.c:4073 do_mkdirat+0x174/0x4d0 fs/namei.c:4098 __do_sys_mkdirat fs/namei.c:4113 [inline] __se_sys_mkdirat fs/namei.c:4111 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111 x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259 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:0x7f3a7057d559 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:00007f3a6efd5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f3a70803fa0 RCX: 00007f3a7057d559 RDX: 0000000000000020 RSI: 0000200000000e80 RDI: ffffffffffffff9c RBP: 00007f3a70614b50 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f3a70804038 R14: 00007f3a70803fa0 R15: 00007ffe51d32cb8 Modules linked in: ---[ end trace b20080872744f819 ]--- RIP: 0010:idr_alloc_cyclic+0xa3/0x5f0 lib/idr.c:121 Code: 01 01 01 01 4b 89 44 2e 08 43 c7 44 2e 10 f3 f3 f3 f3 e8 b0 f7 f9 fe 49 8d 4c 24 14 48 89 4c 24 28 48 c1 e9 03 48 89 4c 24 58 <42> 0f b6 04 29 84 c0 0f 85 39 04 00 00 45 8b 6c 24 14 31 ff 89 de RSP: 0018:ffffc900012074e0 EFLAGS: 00010203 RAX: ffffffff826fdf50 RBX: 0000000000000000 RCX: 0000000000000004 RDX: ffffc9000635d000 RSI: 000000000007ffff RDI: 0000000000080000 RBP: ffffc90001207630 R08: 0000000000000a20 R09: 0000000000000004 R10: dffffc0000000000 R11: fffff52000240eb8 R12: 0000000000000010 R13: dffffc0000000000 R14: 1ffff92000240ea8 R15: 0000000000000001 FS: 00007f3a6efd56c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f03edc49000 CR3: 000000011e324000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 01 01 add %eax,(%rcx) 2: 01 01 add %eax,(%rcx) 4: 4b 89 44 2e 08 mov %rax,0x8(%r14,%r13,1) 9: 43 c7 44 2e 10 f3 f3 movl $0xf3f3f3f3,0x10(%r14,%r13,1) 10: f3 f3 12: e8 b0 f7 f9 fe call 0xfef9f7c7 17: 49 8d 4c 24 14 lea 0x14(%r12),%rcx 1c: 48 89 4c 24 28 mov %rcx,0x28(%rsp) 21: 48 c1 e9 03 shr $0x3,%rcx 25: 48 89 4c 24 58 mov %rcx,0x58(%rsp) * 2a: 42 0f b6 04 29 movzbl (%rcx,%r13,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 0f 85 39 04 00 00 jne 0x470 37: 45 8b 6c 24 14 mov 0x14(%r12),%r13d 3c: 31 ff xor %edi,%edi 3e: 89 de mov %ebx,%esi