KASAN: use-after-free Read in raw_process_ep0_io

Status: upstream: reported on 2026/08/10 15:18
Reported-by: syzbot+1307501250350e4775d3@syzkaller.appspotmail.com
First crash: 1d06h, last: 1d06h
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-1 KASAN: use-after-free Read in raw_process_ep0_io 19 3 2d12h 17d 0/2 premoderation: reported on 2026/07/25 02:03
linux-6.6 KASAN: slab-use-after-free Read in raw_process_ep0_io 19 1 9d08h 9d08h 0/2 upstream: reported on 2026/08/02 13:07
upstream KASAN: slab-use-after-free Read in raw_process_ep0_io prio:normal usb 19 syz, C 18 2h14m 14d 0/29 upstream: reported C repro on 2026/07/28 13:52
android-6-12 KASAN: slab-use-after-free Read in raw_process_ep0_io 19 9 2d10h 9d05h 0/1 premoderation: reported on 2026/08/02 16:20

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:643 [inline]
BUG: KASAN: use-after-free in string+0x204/0x290 lib/vsprintf.c:725
Read of size 1 at addr ffff888146b05900 by task syz.0.159/4922

CPU: 1 PID: 4922 Comm: syz.0.159 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:420
 kasan_report+0x10b/0x140 mm/kasan/report.c:524
 string_nocheck lib/vsprintf.c:643 [inline]
 string+0x204/0x290 lib/vsprintf.c:725
 vsnprintf+0x10db/0x1c20 lib/vsprintf.c:2805
 snprintf+0xe5/0x140 lib/vsprintf.c:2940
 set_dev_info drivers/base/core.c:4936 [inline]
 dev_vprintk_emit+0x303/0x3de drivers/base/core.c:4946
 dev_printk_emit+0xeb/0x139 drivers/base/core.c:4959
 _dev_err+0x11b/0x16c drivers/base/core.c:5014
 raw_process_ep0_io+0x581/0x9a0 drivers/usb/gadget/legacy/raw_gadget.c:683
 raw_ioctl_ep0_write drivers/usb/gadget/legacy/raw_gadget.c:721 [inline]
 raw_ioctl+0x2446/0x3cd0 drivers/usb/gadget/legacy/raw_gadget.c:1268
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f210699dd6b
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007f210777bf50 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f210699dd6b
RDX: 00007f210777bfd0 RSI: 0000000040085503 RDI: 0000000000000004
RBP: 00007f210777bfd0 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000004 R11: 0000000000000246 R12: 00007f210777bfd8
R13: 0000200000000400 R14: 00007f2106c25fa0 R15: 00007ffe4a67ea28
 </TASK>

Allocated by task 1:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc_node_track_caller+0xb0/0x240 mm/slab_common.c:956
 kvasprintf+0xe8/0x1a0 lib/kasprintf.c:25
 kobject_set_name_vargs+0x5d/0x110 lib/kobject.c:265
 dev_set_name+0xdf/0x130 drivers/base/core.c:3485
 usb_add_gadget+0x474/0x6f0 drivers/usb/gadget/udc/core.c:1448
 usb_add_gadget_udc_release+0x198/0x1e0 drivers/usb/gadget/udc/core.c:1506
 dummy_udc_probe+0x686/0x780 drivers/usb/gadget/udc/dummy_hcd.c:1102
 platform_probe+0x137/0x1c0 drivers/base/platform.c:1400
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x24a/0xb40 drivers/base/dd.c:638
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:804
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:834
 __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:962
 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
 __device_attach+0x2a7/0x480 drivers/base/dd.c:1034
 bus_probe_device+0xba/0x1d0 drivers/base/bus.c:489
 device_add+0xbcf/0x1050 drivers/base/core.c:3712
 platform_device_add+0x4bf/0x830 drivers/base/platform.c:717
 dummy_hcd_init+0xc26/0x1167 drivers/usb/gadget/udc/dummy_hcd.c:2883
 do_one_initcall+0x257/0x800 init/main.c:1309
 do_initcall_level+0x13d/0x1ed init/main.c:1382
 do_initcalls+0x4b/0x8a init/main.c:1398
 kernel_init_freeable+0x401/0x5ab init/main.c:1637
 kernel_init+0x19/0x1b0 init/main.c:1525
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Freed by task 4953:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1729 [inline]
 slab_free_freelist_hook+0x133/0x1b0 mm/slub.c:1755
 slab_free mm/slub.c:3687 [inline]
 __kmem_cache_free+0xb6/0x200 mm/slub.c:3700
 kobject_cleanup lib/kobject.c:687 [inline]
 kobject_release lib/kobject.c:712 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x25c/0x450 lib/kobject.c:729
 dummy_udc_remove+0x54/0x60 drivers/usb/gadget/udc/dummy_hcd.c:1123
 platform_remove+0x92/0xe0 drivers/base/platform.c:1422
 device_remove drivers/base/dd.c:547 [inline]
 __device_release_driver drivers/base/dd.c:1279 [inline]
 device_release_driver_internal+0x47d/0x7c0 drivers/base/dd.c:1305
 unbind_store+0x2e2/0x300 drivers/base/bus.c:193
 kernfs_fop_write_iter+0x3a0/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2265 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x482/0x9a0 fs/read_write.c:584
 ksys_write+0x14d/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888146b05900
 which belongs to the cache kmalloc-16 of size 16
The buggy address is located 0 bytes inside of
 16-byte region [ffff888146b05900, ffff888146b05910)

The buggy address belongs to the physical page:
page:ffffea00051ac140 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888146b055c0 pfn:0x146b05
flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff00000000200 ffffea00051cc388 ffffea00051c95c8 ffff8880174413c0
raw: ffff888146b055c0 000000000080006a 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 11585561196, free_ts 0
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2560
 prep_new_page mm/page_alloc.c:2567 [inline]
 get_page_from_freelist+0x206b/0x2180 mm/page_alloc.c:4358
 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5658
 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2115
 alloc_slab_page+0x5d/0x180 mm/slub.c:1799
 allocate_slab mm/slub.c:1944 [inline]
 new_slab+0x87/0x2d0 mm/slub.c:1997
 ___slab_alloc+0xbc5/0x1240 mm/slub.c:3154
 __slab_alloc mm/slub.c:3240 [inline]
 slab_alloc_node mm/slub.c:3325 [inline]
 __kmem_cache_alloc_node+0x126/0x270 mm/slub.c:3398
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc_node_track_caller+0xa0/0x240 mm/slab_common.c:956
 kvasprintf+0xe8/0x1a0 lib/kasprintf.c:25
 kasprintf+0xdf/0x130 lib/kasprintf.c:59
 device_get_devnode+0xab/0x290 drivers/base/core.c:3997
 dev_uevent+0x162/0x740 drivers/base/core.c:2581
 kobject_uevent_env+0x45b/0x890 lib/kobject_uevent.c:572
 device_add+0xac2/0x1050 drivers/base/core.c:3678
 usb_new_device+0xa01/0x15e0 drivers/usb/core/hub.c:2659
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888146b05800: fb fb fc fc 00 04 fc fc 00 04 fc fc 00 04 fc fc
 ffff888146b05880: fa fb fc fc fa fb fc fc 00 04 fc fc 00 04 fc fc
>ffff888146b05900: fa fb fc fc 00 01 fc fc 00 01 fc fc 00 04 fc fc
                   ^
 ffff888146b05980: 00 04 fc fc 00 04 fc fc 00 04 fc fc 00 04 fc fc
 ffff888146b05a00: 00 04 fc fc 00 04 fc fc 00 01 fc fc 00 01 fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/10 15:18 linux-6.1.y e4f7d8be268e 5d63f80b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in raw_process_ep0_io
* Struck through repros no longer work on HEAD.