==================================================================
BUG: KASAN: use-after-free in kobject_get+0x113/0x120 lib/kobject.c:663
Read of size 1 at addr ffff88811ce7603c by task syz.2.1386/5282
CPU: 0 PID: 5282 Comm: syz.2.1386 Tainted: G W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/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:3520 [inline]
device_add+0x2f0/0xe90 drivers/base/core.c:3344
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
Allocated by task 280:
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]
__kmalloc_track_caller+0x13c/0x2c0 mm/slub.c:4959
kmalloc_reserve net/core/skbuff.c:357 [inline]
__alloc_skb+0x210/0x730 net/core/skbuff.c:428
alloc_skb_fclone include/linux/skbuff.h:1233 [inline]
sk_stream_alloc_skb+0x216/0xb70 net/ipv4/tcp.c:892
tcp_sendmsg_locked+0xcbb/0x3330 net/ipv4/tcp.c:1317
tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1460
inet_sendmsg+0xa5/0xc0 net/ipv4/af_inet.c:830
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
sock_write_iter+0x2a6/0x3a0 net/socket.c:1080
call_write_iter include/linux/fs.h:2220 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x831/0xfd0 fs/read_write.c:594
ksys_write+0x14a/0x260 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
x64_sys_call+0x8ef/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
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 3008:
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
skb_free_head net/core/skbuff.c:656 [inline]
skb_release_data+0x7bd/0xa20 net/core/skbuff.c:678
skb_release_all net/core/skbuff.c:743 [inline]
__kfree_skb+0x50/0x70 net/core/skbuff.c:757
sk_wmem_free_skb include/net/sock.h:1671 [inline]
tcp_rtx_queue_unlink_and_free+0x205/0x720 include/net/tcp.h:1912
tcp_clean_rtx_queue net/ipv4/tcp_input.c:3408 [inline]
tcp_ack+0x22ea/0x6200 net/ipv4/tcp_input.c:3965
tcp_rcv_established+0xd67/0x1af0 net/ipv4/tcp_input.c:5990
tcp_v4_do_rcv+0x591/0x9f0 net/ipv4/tcp_ipv4.c:1726
tcp_v4_rcv+0x221a/0x2880 net/ipv4/tcp_ipv4.c:2138
ip_protocol_deliver_rcu+0x360/0x760 net/ipv4/ip_input.c:204
ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline]
NF_HOOK include/linux/netfilter.h:305 [inline]
ip_local_deliver+0x2dd/0x520 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:463 [inline]
ip_sublist_rcv_finish net/ipv4/ip_input.c:577 [inline]
ip_list_rcv_finish net/ipv4/ip_input.c:628 [inline]
ip_sublist_rcv+0x75f/0x8b0 net/ipv4/ip_input.c:636
ip_list_rcv+0x3e4/0x430 net/ipv4/ip_input.c:671
__netif_receive_skb_list_ptype net/core/dev.c:5610 [inline]
__netif_receive_skb_list_core+0x57e/0x770 net/core/dev.c:5658
__netif_receive_skb_list net/core/dev.c:5710 [inline]
netif_receive_skb_list_internal+0x7f8/0xaa0 net/core/dev.c:5801
gro_normal_list net/core/dev.c:5955 [inline]
napi_complete_done+0x375/0x7a0 net/core/dev.c:6693
virtqueue_napi_complete drivers/net/virtio_net.c:357 [inline]
virtnet_poll+0x9b6/0xfb0 drivers/net/virtio_net.c:1627
__napi_poll+0xbb/0x580 net/core/dev.c:7117
napi_poll net/core/dev.c:7184 [inline]
net_rx_action+0x37f/0x910 net/core/dev.c:7274
handle_softirqs+0x250/0x560 kernel/softirq.c:583
__do_softirq kernel/softirq.c:621 [inline]
invoke_softirq kernel/softirq.c:443 [inline]
__irq_exit_rcu+0x52/0xf0 kernel/softirq.c:670
irq_exit_rcu+0x9/0x10 kernel/softirq.c:682
common_interrupt+0xbe/0xe0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x27/0x40 arch/x86/include/asm/idtentry.h:667
The buggy address belongs to the object at ffff88811ce76000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 60 bytes inside of
1024-byte region [ffff88811ce76000, ffff88811ce76400)
The buggy address belongs to the page:
page:ffffea0004739c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11ce70
head:ffffea0004739c00 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 0, ts 14964058305, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2611
prep_new_page+0x1c/0x110 mm/page_alloc.c:2617
get_page_from_freelist+0x2d42/0x2dd0 mm/page_alloc.c:4500
__alloc_pages+0x1a2/0x460 mm/page_alloc.c:5837
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]
__tcp_send_ack+0x9b/0x6c0 net/ipv4/tcp_output.c:4000
tcp_send_ack+0x3b/0x60 net/ipv4/tcp_output.c:4032
__tcp_ack_snd_check+0x40e/0x900 net/ipv4/tcp_input.c:5606
tcp_rcv_established+0x11a0/0x1af0 net/ipv4/tcp_input.c:6042
tcp_v4_do_rcv+0x591/0x9f0 net/ipv4/tcp_ipv4.c:1726
tcp_v4_rcv+0x221a/0x2880 net/ipv4/tcp_ipv4.c:2138
ip_protocol_deliver_rcu+0x360/0x760 net/ipv4/ip_input.c:204
page_owner free stack trace missing
Memory state around the buggy address:
ffff88811ce75f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88811ce75f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88811ce76000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88811ce76080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811ce76100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
kobject: '' (ffff88811ce76000): is not initialized, yet kobject_get() is being called.
WARNING: CPU: 1 PID: 5282 at lib/kobject.c:666 kobject_get+0x7c/0x120 lib/kobject.c:664
Modules linked in:
CPU: 1 PID: 5282 Comm: syz.2.1386 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:kobject_get+0x7c/0x120 lib/kobject.c:664
Code: f9 fe 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 16 c6 38 ff 48 8b 33 48 c7 c7 80 e0 64 85 48 89 da e8 94 f7 3f 02 <0f> 0b eb 0c e8 5b 0b f9 fe eb 4c e8 54 0b f9 fe 4c 8d 73 38 4c 89
RSP: 0018:ffffc90000c77a18 EFLAGS: 00010246
RAX: 432a0c41788b9100 RBX: ffff88811ce76000 RCX: 0000000000080000
RDX: ffffc90006fde000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90000c77a30 R08: ffff8881f7132eff R09: 1ffff1103ee265df
R10: dffffc0000000000 R11: ffffed103ee265e0 R12: 1ffff1102501680e
R13: dffffc0000000000 R14: 0000000000000000 R15: dffffc0000000000
FS: 00007fad9a2656c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffc11746ff8 CR3: 000000011c1df000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000008000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Call Trace:
get_device drivers/base/core.c:3520 [inline]
device_add+0x2f0/0xe90 drivers/base/core.c:3344
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
---[ end trace a3788995753d00fc ]---
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 0 PID: 5282 at lib/refcount.c:25 refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25
Modules linked in:
CPU: 0 PID: 5282 Comm: syz.2.1386 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25
Code: 04 01 48 c7 c7 e0 64 63 85 e8 68 ca 5f 02 0f 0b eb df e8 2f de 18 ff c6 05 be ea b5 04 01 48 c7 c7 20 64 63 85 e8 4c ca 5f 02 <0f> 0b eb c3 e8 13 de 18 ff c6 05 a3 ea b5 04 01 48 c7 c7 80 64 63
RSP: 0018:ffffc90000c779f8 EFLAGS: 00010246
RAX: 432a0c41788b9100 RBX: 0000000000000002 RCX: 0000000000080000
RDX: ffffc90006fde000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90000c77a08 R08: ffff8881f7027493 R09: 1ffff1103ee04e92
R10: dffffc0000000000 R11: ffffed103ee04e93 R12: 1ffff1102501680e
R13: dffffc0000000000 R14: 0000000000000002 R15: 0000000000000000
FS: 00007fad9a2656c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000011c1df000 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:3520 [inline]
device_add+0x2f0/0xe90 drivers/base/core.c:3344
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
---[ end trace a3788995753d00fd ]---
------------[ cut here ]------------
kobject: '' (ffff88811ce76000): is not initialized, yet kobject_get() is being called.
WARNING: CPU: 0 PID: 5282 at lib/kobject.c:666 kobject_get lib/kobject.c:664 [inline]
WARNING: CPU: 0 PID: 5282 at lib/kobject.c:666 kobject_add_internal+0x12e/0xde0 lib/kobject.c:248
Modules linked in:
CPU: 0 PID: 5282 Comm: syz.2.1386 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:kobject_get lib/kobject.c:664 [inline]
RIP: 0010:kobject_add_internal+0x12e/0xde0 lib/kobject.c:248
Code: b9 00 00 00 00 00 fc ff df 80 3c 08 00 74 08 4c 89 e7 e8 95 ad 38 ff 49 8b 34 24 48 c7 c7 80 e0 64 85 4c 89 e2 e8 12 df 3f 02 <0f> 0b e9 04 01 00 00 e8 d6 f2 f8 fe b8 fe ff ff ff e9 b0 09 00 00
RSP: 0018:ffffc90000c77898 EFLAGS: 00010246
RAX: 432a0c41788b9100 RBX: ffff8881159a7400 RCX: 0000000000080000
RDX: ffffc90006fde000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90000c778f0 R08: ffffc90000c77307 R09: 1ffff9200018ee60
R10: dffffc0000000000 R11: fffff5200018ee61 R12: ffff88811ce76000
R13: ffff8881159a7418 R14: 0000000000000000 R15: 1ffff11022b34e80
FS: 00007fad9a2656c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000011c1df000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
kobject_add_varg lib/kobject.c:398 [inline]
kobject_add+0x165/0x230 lib/kobject.c:450
class_dir_create_and_add drivers/base/core.c:2978 [inline]
get_device_parent+0x3a6/0x410 drivers/base/core.c:3033
device_add+0x308/0xe90 drivers/base/core.c:3345
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
---[ end trace a3788995753d00fe ]---
------------[ cut here ]------------
refcount_t: saturated; leaking memory.
WARNING: CPU: 0 PID: 5282 at lib/refcount.c:22 refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22
Modules linked in:
CPU: 0 PID: 5282 Comm: syz.2.1386 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22
Code: 04 01 48 c7 c7 c0 63 63 85 e8 14 ca 5f 02 0f 0b eb 8b e8 db dd 18 ff c6 05 69 ea b5 04 01 48 c7 c7 c0 63 63 85 e8 f8 c9 5f 02 <0f> 0b e9 6c ff ff ff e8 bc dd 18 ff c6 05 4e ea b5 04 01 48 c7 c7
RSP: 0018:ffffc90000c77878 EFLAGS: 00010246
RAX: 432a0c41788b9100 RBX: 0000000000000001 RCX: 0000000000080000
RDX: ffffc90006fde000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90000c77888 R08: ffffc90000c772e7 R09: 1ffff9200018ee5c
R10: dffffc0000000000 R11: fffff5200018ee5d R12: 00000000c0000000
R13: ffff8881159a7418 R14: 0000000000000001 R15: ffff88811ce76038
FS: 00007fad9a2656c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000011c1df000 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 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
class_dir_create_and_add drivers/base/core.c:2978 [inline]
get_device_parent+0x3a6/0x410 drivers/base/core.c:3033
device_add+0x308/0xe90 drivers/base/core.c:3345
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
---[ end trace a3788995753d00ff ]---
------------[ cut here ]------------
kobject: '' (ffff88811ce76000): is not initialized, yet kobject_put() is being called.
WARNING: CPU: 0 PID: 5282 at lib/kobject.c:760 kobject_put+0x8a/0x270 lib/kobject.c:758
Modules linked in:
CPU: 0 PID: 5282 Comm: syz.2.1386 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:kobject_put+0x8a/0x270 lib/kobject.c:758
Code: 48 b9 00 00 00 00 00 fc ff df 80 3c 08 00 74 08 48 89 df e8 e8 c4 38 ff 48 8b 33 48 c7 c7 00 e1 64 85 48 89 da e8 66 f6 3f 02 <0f> 0b eb 0f e8 2d 0a f9 fe e9 7c 01 00 00 e8 23 0a f9 fe 4c 8d 7b
RSP: 0018:ffffc90000c77860 EFLAGS: 00010246
RAX: 432a0c41788b9100 RBX: ffff88811ce76000 RCX: 0000000000080000
RDX: ffffc90006fde000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90000c77888 R08: ffff8881f7032eff R09: 1ffff1103ee065df
R10: dffffc0000000000 R11: ffffed103ee065e0 R12: ffff88811ce76000
R13: ffff88811ce7603c R14: 1ffff110239cec07 R15: 0000000000000000
FS: 00007fad9a2656c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000011c1df000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
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
class_dir_create_and_add drivers/base/core.c:2978 [inline]
get_device_parent+0x3a6/0x410 drivers/base/core.c:3033
device_add+0x308/0xe90 drivers/base/core.c:3345
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
---[ end trace a3788995753d0100 ]---
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 5282 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 5282 Comm: syz.2.1386 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 04 01 48 c7 c7 20 64 63 85 e8 4c ca 5f 02 0f 0b eb c3 e8 13 de 18 ff c6 05 a3 ea b5 04 01 48 c7 c7 80 64 63 85 e8 30 ca 5f 02 <0f> 0b eb a7 e8 f7 dd 18 ff c6 05 84 ea b5 04 01 48 c7 c7 c0 63 63
RSP: 0018:ffffc90000c77840 EFLAGS: 00010246
RAX: 432a0c41788b9100 RBX: 0000000000000003 RCX: 0000000000080000
RDX: ffffc90006fde000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90000c77850 R08: ffff8881f7032eff R09: 1ffff1103ee065df
R10: dffffc0000000000 R11: ffffed103ee065e0 R12: 00000000c0000000
R13: ffff88811ce7603c R14: 0000000000000003 R15: ffff88811ce76038
FS: 00007fad9a2656c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000011c1df000 CR4: 00000000003506b0
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
class_dir_create_and_add drivers/base/core.c:2978 [inline]
get_device_parent+0x3a6/0x410 drivers/base/core.c:3033
device_add+0x308/0xe90 drivers/base/core.c:3345
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
---[ end trace a3788995753d0101 ]---
kobject_add_internal failed for android_usb (error: -2 parent: )
------------[ cut here ]------------
kobject: '' (ffff88811ce76000): is not initialized, yet kobject_put() is being called.
WARNING: CPU: 1 PID: 5282 at lib/kobject.c:760 kobject_put+0x8a/0x270 lib/kobject.c:758
Modules linked in:
CPU: 1 PID: 5282 Comm: syz.2.1386 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:kobject_put+0x8a/0x270 lib/kobject.c:758
Code: 48 b9 00 00 00 00 00 fc ff df 80 3c 08 00 74 08 48 89 df e8 e8 c4 38 ff 48 8b 33 48 c7 c7 00 e1 64 85 48 89 da e8 66 f6 3f 02 <0f> 0b eb 0f e8 2d 0a f9 fe e9 7c 01 00 00 e8 23 0a f9 fe 4c 8d 7b
RSP: 0018:ffffc90000c77a08 EFLAGS: 00010246
RAX: 432a0c41788b9100 RBX: ffff88811ce76000 RCX: 0000000000080000
RDX: ffffc90006fde000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90000c77a30 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff5200018eea0 R12: ffff8881280b4068
R13: ffff88811ce7603c R14: 1ffff110239cec07 R15: 0000000000000000
FS: 00007fad9a2656c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffc1181f000 CR3: 000000011c1df000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
put_device drivers/base/core.c:3532 [inline]
device_add+0x985/0xe90 drivers/base/core.c:3477
device_create_groups_vargs drivers/base/core.c:4120 [inline]
device_create+0x26c/0x300 drivers/base/core.c:4162
create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
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:0x7fad9b817a99
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:00007fad9a265028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fad9baa3fa0 RCX: 00007fad9b817a99
RDX: 00000000000001ff RSI: 0000200000000940 RDI: ffffffffffffff9c
RBP: 00007fad9b8a718b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fad9baa4038 R14: 00007fad9baa3fa0 R15: 00007ffc35d576b8
---[ end trace a3788995753d0102 ]---