==================================================================
BUG: KASAN: use-after-free in kobject_get+0x113/0x120 lib/kobject.c:663
Read of size 1 at addr ffff8881107cd83c by task syz.6.341/1804
CPU: 0 PID: 1804 Comm: syz.6.341 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:0x7f9779898559
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:00007f97782f0028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f9779b1efa0 RCX: 00007f9779898559
RDX: 0000000000000020 RSI: 0000200000000e80 RDI: ffffffffffffff9c
RBP: 00007f977992fb50 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9779b1f038 R14: 00007f9779b1efa0 R15: 00007ffc4098b5b8
The buggy address belongs to the page:
page:ffffea000441f340 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1107cd
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 0000000000000000 ffffea000441f348 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 101, ts 5609513491, free_ts 34937961967
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 last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1477 [inline]
free_pcp_prepare mm/page_alloc.c:1549 [inline]
free_unref_page_prepare+0x5fa/0x600 mm/page_alloc.c:3540
free_unref_page+0xae/0x540 mm/page_alloc.c:3622
free_the_page mm/page_alloc.c:808 [inline]
__free_pages+0x6c/0x100 mm/page_alloc.c:5905
__free_slab+0xe5/0x1e0 mm/slub.c:2025
free_slab mm/slub.c:2040 [inline]
discard_slab+0x29/0x40 mm/slub.c:2046
__slab_free+0x211/0x290 mm/slub.c:3431
do_slab_free mm/slub.c:3514 [inline]
___cache_free+0x104/0x120 mm/slub.c:3535
qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157
qlist_free_all+0x5f/0xb0 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x14a/0x170 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443
kasan_slab_alloc include/linux/kasan.h:217 [inline]
slab_post_alloc_hook+0x4f/0x2b0 mm/slab.h:550
slab_alloc_node mm/slub.c:3245 [inline]
slab_alloc mm/slub.c:3255 [inline]
kmem_cache_alloc+0xf7/0x260 mm/slub.c:3260
getname_flags+0xba/0x510 fs/namei.c:138
getname+0x19/0x20 fs/namei.c:217
do_sys_openat2+0xeb/0x7f0 fs/open.c:1230
Memory state around the buggy address:
ffff8881107cd700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881107cd780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881107cd800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881107cd880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881107cd900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 1804 at lib/refcount.c:25 refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25
Modules linked in:
CPU: 1 PID: 1804 Comm: syz.6.341 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026
RIP: 0010:refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25
Code: 04 01 48 c7 c7 a0 58 63 85 e8 78 d0 5b 02 0f 0b eb df e8 2f 59 19 ff c6 05 0d c5 95 04 01 48 c7 c7 e0 57 63 85 e8 5c d0 5b 02 <0f> 0b eb c3 e8 13 59 19 ff c6 05 f2 c4 95 04 01 48 c7 c7 40 58 63
RSP: 0018:ffffc90000dff9f8 EFLAGS: 00010246
RAX: f2b9460e0b16b700 RBX: 0000000000000002 RCX: ffff88813651e400
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90000dffa08 R08: ffff8881f7132eff R09: 1ffff1103ee265df
R10: dffffc0000000000 R11: ffffed103ee265e0 R12: 1ffff1102686410e
R13: dffffc0000000000 R14: 0000000000000002 R15: 0000000000000000
FS: 00007f97782f06c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000bbdffc CR3: 0000000119f3e000 CR4: 00000000003506a0
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:0x7f9779898559
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:00007f97782f0028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f9779b1efa0 RCX: 00007f9779898559
RDX: 0000000000000020 RSI: 0000200000000e80 RDI: ffffffffffffff9c
RBP: 00007f977992fb50 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9779b1f038 R14: 00007f9779b1efa0 R15: 00007ffc4098b5b8
---[ end trace 5394846663cb9381 ]---
------------[ cut here ]------------
refcount_t: saturated; leaking memory.
WARNING: CPU: 1 PID: 1804 at lib/refcount.c:22 refcount_warn_saturate+0x158/0x1a0 lib/refcount.c:22
Modules linked in:
CPU: 1 PID: 1804 Comm: syz.6.341 Tainted: G B W 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:ffffc90000dff8b8 EFLAGS: 00010246
RAX: f2b9460e0b16b700 RBX: 0000000000000001 RCX: ffff88813651e400
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90000dff8c8 R08: ffff8881f7132eff R09: 1ffff1103ee265df
R10: dffffc0000000000 R11: ffffed103ee265e0 R12: 00000000c0000000
R13: ffff888134320818 R14: 0000000000000001 R15: ffff8881107cd838
FS: 00007f97782f06c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2d621ff8 CR3: 0000000119f3e000 CR4: 00000000003506a0
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+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:0x7f9779898559
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:00007f97782f0028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f9779b1efa0 RCX: 00007f9779898559
RDX: 0000000000000020 RSI: 0000200000000e80 RDI: ffffffffffffff9c
RBP: 00007f977992fb50 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9779b1f038 R14: 00007f9779b1efa0 R15: 00007ffc4098b5b8
---[ end trace 5394846663cb9382 ]---
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 1804 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 1804 Comm: syz.6.341 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 04 01 48 c7 c7 e0 57 63 85 e8 5c d0 5b 02 0f 0b eb c3 e8 13 59 19 ff c6 05 f2 c4 95 04 01 48 c7 c7 40 58 63 85 e8 40 d0 5b 02 <0f> 0b eb a7 e8 f7 58 19 ff c6 05 d3 c4 95 04 01 48 c7 c7 80 57 63
RSP: 0018:ffffc90000dff880 EFLAGS: 00010246
RAX: f2b9460e0b16b700 RBX: 0000000000000003 RCX: ffff88813651e400
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90000dff890 R08: ffff8881f7027493 R09: 1ffff1103ee04e92
R10: dffffc0000000000 R11: ffffed103ee04e93 R12: 00000000c0000000
R13: ffff8881107cd83c R14: 0000000000000003 R15: ffff8881107cd838
FS: 00007f97782f06c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa344fa22f8 CR3: 0000000119f3e000 CR4: 00000000003506a0
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+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:0x7f9779898559
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:00007f97782f0028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f9779b1efa0 RCX: 00007f9779898559
RDX: 0000000000000020 RSI: 0000200000000e80 RDI: ffffffffffffff9c
RBP: 00007f977992fb50 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9779b1f038 R14: 00007f9779b1efa0 R15: 00007ffc4098b5b8
---[ end trace 5394846663cb9383 ]---
kobject_add_internal failed for f_midi (error: -2 parent: €Š+�ˆÿÿk)