syzbot
KASAN: stack-out-of-bounds Write in append_midi1_out_jack
Status:
upstream: reported C repro on 2026/08/26 11:49
Subsystems:
usb
[Documentation on labels]
Reported-by: syzbot+c35f34092a4bc9855be6@syzkaller.appspotmail.com
First crash: 8d11h, last: 1d19h
▶
▼
Last patch testing requests (3)
Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in append_midi1_out_jack.isra.0+0x38c/0x470 drivers/usb/gadget/function/f_midi2.c:1713
Write of size 1 at addr ffffc90003067880 by task syz-executor233/6025
CPU: 3 UID: 0 PID: 6025 Comm: syz-executor233 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
append_midi1_out_jack.isra.0+0x38c/0x470 drivers/usb/gadget/function/f_midi2.c:1713
f_midi2_create_usb_configs+0x748/0xdf0 drivers/usb/gadget/function/f_midi2.c:1815
f_midi2_bind+0x1d12/0x2770 drivers/usb/gadget/function/f_midi2.c:2013
usb_add_function+0x219/0x890 drivers/usb/gadget/composite.c:333
configfs_composite_bind+0xd83/0x1960 drivers/usb/gadget/configfs.c:1802
gadget_bind_driver+0x28c/0xbf0 drivers/usb/gadget/udc/core.c:1662
call_driver_probe drivers/base/dd.c:628 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:706
__driver_probe_device+0x210/0x460 drivers/base/dd.c:868
driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
__driver_attach+0x21f/0x5b0 drivers/base/dd.c:1292
bus_for_each_dev+0x13e/0x1d0 drivers/base/bus.c:383
bus_add_driver+0x305/0x5b0 drivers/base/bus.c:763
driver_register+0x1e2/0x360 drivers/base/driver.c:174
usb_gadget_register_driver_owner+0x132/0x210 drivers/usb/gadget/udc/core.c:1752
gadget_dev_desc_UDC_store+0x1b0/0x2e0 drivers/usb/gadget/configfs.c:300
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x302/0x4e0 fs/configfs/file.c:229
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6af/0x1050 fs/read_write.c:687
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f84b9f19bf7
Code: 48 89 fa 4c 89 df e8 98 1d 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007fffbbaac100 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000555593d6d400 RCX: 00007f84b9f19bf7
RDX: 000000000000000b RSI: 00007fffbbaac270 RDI: 0000000000000003
RBP: 00007fffbbaac270 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00007fffbbaac370
R13: 00007fffbbaac170 R14: 00007f84b9f521d8 R15: 00007fffbbaac270
</TASK>
The buggy address belongs to stack of task syz-executor233/6025
and is located at offset 440 in frame:
f_midi2_bind+0x0/0x2770 drivers/usb/gadget/function/f_midi2.c:1768
This frame has 6 objects:
[32, 36) 'sw'
[48, 56) 'card'
[80, 88) 'ump'
[112, 128) 'string_fn'
[144, 160) 'strings'
[176, 440) 'config'
The buggy address belongs to a 8-page vmalloc region starting at 0xffffc90003060000 allocated at kernel_clone+0x176/0x9d0 kernel/fork.c:2772
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x54bb7
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 ffffea000152edc8 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x29c2(GFP_NOWAIT|__GFP_HIGHMEM|__GFP_IO|__GFP_FS|__GFP_ZERO), pid 5434, tgid 5434 (dhcpcd), ts 75918903758
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0x110d/0x35b0 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436
alloc_pages_mpol+0x201/0x550 mm/mempolicy.c:2495
alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2586
vm_area_alloc_pages mm/vmalloc.c:3690 [inline]
__vmalloc_area_node mm/vmalloc.c:3915 [inline]
__vmalloc_node_range_noprof+0xdcc/0x1460 mm/vmalloc.c:4105
__vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4166
alloc_thread_stack_node kernel/fork.c:359 [inline]
dup_task_struct kernel/fork.c:930 [inline]
copy_process+0x803/0x8370 kernel/fork.c:2139
kernel_clone+0x176/0x9d0 kernel/fork.c:2772
__do_sys_clone3+0x214/0x290 kernel/fork.c:3075
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5433 tgid 5433 ts 75917589560 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
__free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962
skb_kfree_head net/core/skbuff.c:1083 [inline]
skb_free_head+0xb9/0x160 net/core/skbuff.c:1095
skb_release_data+0x6c5/0x8e0 net/core/skbuff.c:1122
skb_release_all net/core/skbuff.c:1197 [inline]
__kfree_skb net/core/skbuff.c:1211 [inline]
consume_skb net/core/skbuff.c:1445 [inline]
consume_skb+0xc4/0x110 net/core/skbuff.c:1439
netlink_recvmsg+0x5b9/0xa90 net/netlink/af_netlink.c:1978
sock_recvmsg_nosec net/socket.c:1151 [inline]
sock_recvmsg+0x1d5/0x220 net/socket.c:1173
____sys_recvmsg+0x21e/0x670 net/socket.c:2933
___sys_recvmsg+0x16a/0x1a0 net/socket.c:2975
__sys_recvmsg net/socket.c:3008 [inline]
__do_sys_recvmsg net/socket.c:3014 [inline]
__se_sys_recvmsg net/socket.c:3011 [inline]
__x64_sys_recvmsg+0x19a/0x260 net/socket.c:3011
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffffc90003067780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90003067800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90003067880: f3 f3 f3 f3 f3 f3 f3 f3 f3 00 00 00 00 00 00 00
^
ffffc90003067900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90003067980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
* Struck through repros no longer work on HEAD.