Hello,
syzbot found the following issue on:
HEAD commit: dc5c83b7f5f8 Linux 6.1.178
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=16e0788e580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=872c04466179833f
dashboard link:
https://syzkaller.appspot.com/bug?extid=e2a5ffd1302802e8a2cc
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
userspace arch: arm64
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/96393e4697a3/disk-dc5c83b7.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/0d4afce44fab/vmlinux-dc5c83b7.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/4787e310d875/Image-dc5c83b7.gz.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+e2a5ff...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in gphonet_set_gadget drivers/usb/gadget/function/f_phonet.c:720 [inline]
BUG: KASAN: use-after-free in pn_bind+0x100/0x9c0 drivers/usb/gadget/function/f_phonet.c:510
Write of size 8 at addr ffff0000f29ce6c0 by task syz.1.372/6146
CPU: 0 PID: 6146 Comm: syz.1.372 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
Call trace:
dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
print_address_description+0x88/0x218 mm/kasan/report.c:316
print_report+0x50/0x68 mm/kasan/report.c:420
kasan_report+0xa8/0xfc mm/kasan/report.c:524
__asan_report_store8_noabort+0x2c/0x38 mm/kasan/report_generic.c:356
gphonet_set_gadget drivers/usb/gadget/function/f_phonet.c:720 [inline]
pn_bind+0x100/0x9c0 drivers/usb/gadget/function/f_phonet.c:510
usb_add_function+0x234/0x7a8 drivers/usb/gadget/composite.c:337
configfs_composite_bind+0x7e0/0xce4 drivers/usb/gadget/configfs.c:1409
gadget_bind_driver+0x26c/0x684 drivers/usb/gadget/udc/core.c:1651
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x3a0/0xac4 drivers/base/dd.c:638
__driver_probe_device+0x1c8/0x368 drivers/base/dd.c:804
driver_probe_device+0x78/0x324 drivers/base/dd.c:834
__driver_attach+0x3bc/0x614 drivers/base/dd.c:1220
bus_for_each_dev+0x148/0x1d0 drivers/base/bus.c:303
driver_attach+0x50/0x60 drivers/base/dd.c:1237
bus_add_driver+0x2c0/0x518 drivers/base/bus.c:620
driver_register+0x200/0x37c drivers/base/driver.c:246
usb_gadget_register_driver_owner+0xf0/0x25c drivers/usb/gadget/udc/core.c:1730
gadget_dev_desc_UDC_store+0x168/0x268 drivers/usb/gadget/configfs.c:290
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x260/0x338 fs/configfs/file.c:229
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x3c8/0x7c8 fs/read_write.c:584
ksys_write+0x12c/0x228 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
Allocated by task 4814:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:53
kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:384
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:936 [inline]
__kmalloc_node+0xdc/0x184 mm/slab_common.c:943
kmalloc_node include/linux/slab.h:589 [inline]
kvmalloc_node+0x88/0x1d4 mm/util.c:581
kvmalloc include/linux/slab.h:716 [inline]
seq_buf_alloc fs/seq_file.c:38 [inline]
seq_read_iter+0x1d8/0xc24 fs/seq_file.c:210
kernfs_fop_read_iter+0x13c/0x5d8 fs/kernfs/file.c:297
call_read_iter include/linux/fs.h:2259 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x3cc/0x7b8 fs/read_write.c:470
ksys_read+0x12c/0x228 fs/read_write.c:613
__do_sys_read fs/read_write.c:623 [inline]
__se_sys_read fs/read_write.c:621 [inline]
__arm64_sys_read+0x7c/0x90 fs/read_write.c:621
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
The buggy address belongs to the object at ffff0000f29ce000
which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 1728 bytes inside of
4096-byte region [ffff0000f29ce000, ffff0000f29cf000)
The buggy address belongs to the physical page:
page:00000000e50055bb refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000f29cc000 pfn:0x1329c8
head:00000000e50055bb order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff0000df8b1b01
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc0003d39208 fffffc0003d04408 ffff0000c0003500
raw: ffff0000f29cc000 0000000000040002 00000001ffffffff ffff0000df8b1b01
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff0000f29ce580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000f29ce600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000f29ce680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000f29ce700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000f29ce780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
kernel BUG at net/core/dev.c:10149!
Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 6146 Comm: syz.1.372 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : register_netdevice+0x1624/0x1650 net/core/dev.c:10149
lr : register_netdevice+0x1624/0x1650 net/core/dev.c:10149
sp : ffff8000211e7400
x29: ffff8000211e74d0 x28: dfff800000000000 x27: ffff0000d28c60d8
x26: ffff8000211e7460 x25: ffff0000f29ce000 x24: ffff70000423ce8c
x23: 0000000000000000 x22: dfff800000000000 x21: 1fffe0001e539cc7
x20: 0000000000000000 x19: ffff0000f29ce000 x18: 1fffe00033e7277e
x17: 0000000000000000 x16: ffff800011b90540 x15: 0000000000000002
x14: 0000000000000001 x13: 1ffff00002f409bc x12: 0000000000080000
x11: 0000000000024630 x10: ffff80002292b000 x9 : ffff80000ff14040
x8 : 0000000000024631 x7 : 0000000000000000 x6 : ffff80000ff4aac8
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80000ff13d40
x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
register_netdevice+0x1624/0x1650 net/core/dev.c:10149
register_netdev+0x48/0x64 net/core/dev.c:10371
gphonet_register_netdev drivers/usb/gadget/function/f_phonet.c:727 [inline]
pn_bind+0x110/0x9c0 drivers/usb/gadget/function/f_phonet.c:511
usb_add_function+0x234/0x7a8 drivers/usb/gadget/composite.c:337
configfs_composite_bind+0x7e0/0xce4 drivers/usb/gadget/configfs.c:1409
gadget_bind_driver+0x26c/0x684 drivers/usb/gadget/udc/core.c:1651
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x3a0/0xac4 drivers/base/dd.c:638
__driver_probe_device+0x1c8/0x368 drivers/base/dd.c:804
driver_probe_device+0x78/0x324 drivers/base/dd.c:834
__driver_attach+0x3bc/0x614 drivers/base/dd.c:1220
bus_for_each_dev+0x148/0x1d0 drivers/base/bus.c:303
driver_attach+0x50/0x60 drivers/base/dd.c:1237
bus_add_driver+0x2c0/0x518 drivers/base/bus.c:620
driver_register+0x200/0x37c drivers/base/driver.c:246
usb_gadget_register_driver_owner+0xf0/0x25c drivers/usb/gadget/udc/core.c:1730
gadget_dev_desc_UDC_store+0x168/0x268 drivers/usb/gadget/configfs.c:290
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x260/0x338 fs/configfs/file.c:229
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x3c8/0x7c8 fs/read_write.c:584
ksys_write+0x12c/0x228 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
Code: d4210000 96167c0b d4210000 96167c09 (d4210000)
---[ end trace 0000000000000000 ]---
---
This report is generated by a bot. It may contain errors.
See
https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup