KASAN: slab-use-after-free Read in raw_process_ep0_io

Status: upstream: reported on 2026/08/02 13:07
Reported-by: syzbot+07748614c3a98dea5926@syzkaller.appspotmail.com
First crash: 2d09h, last: 2d09h
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in raw_process_ep0_io prio:normal usb 19 syz, C 9 3d12h 7d09h 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 4 6h26m 2d06h 0/1 premoderation: reported on 2026/08/02 16:20
android-6-1 KASAN: use-after-free Read in raw_process_ep0_io 19 1 10d 10d 0/2 premoderation: reported on 2026/07/25 02:03

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in string_nocheck lib/vsprintf.c:645 [inline]
BUG: KASAN: slab-use-after-free in string+0x204/0x290 lib/vsprintf.c:727
Read of size 1 at addr ffff888025cade00 by task syz.0.1899/13899

CPU: 1 PID: 13899 Comm: syz.0.1899 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:468
 kasan_report+0x117/0x150 mm/kasan/report.c:581
 string_nocheck lib/vsprintf.c:645 [inline]
 string+0x204/0x290 lib/vsprintf.c:727
 vsnprintf+0xf72/0x1ba0 lib/vsprintf.c:2823
 snprintf+0xe9/0x140 lib/vsprintf.c:2958
 set_dev_info drivers/base/core.c:4958 [inline]
 dev_vprintk_emit+0x310/0x3f0 drivers/base/core.c:4968
 dev_printk_emit+0xef/0x140 drivers/base/core.c:4981
 _dev_err+0x11f/0x170 drivers/base/core.c:5036
 raw_process_ep0_io+0x581/0x9a0 drivers/usb/gadget/legacy/raw_gadget.c:683
 raw_ioctl_ep0_read drivers/usb/gadget/legacy/raw_gadget.c:736 [inline]
 raw_ioctl+0x28cb/0x3d80 drivers/usb/gadget/legacy/raw_gadget.c:1271
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fd4d399dcab
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:00007fd4d4834f50 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fd4d399dcab
RDX: 00007fd4d4834fd0 RSI: 00000000c0085504 RDI: 0000000000000003
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000003 R11: 0000000000000246 R12: 00007fd4d4834fd8
R13: 0000000000000000 R14: 00007fd4d3c25fa0 R15: 00007fffbebb2278
 </TASK>

Allocated by task 13876:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:198 [inline]
 __do_kmalloc_node mm/slab_common.c:1007 [inline]
 __kmalloc_node_track_caller+0xb4/0x230 mm/slab_common.c:1027
 kvasprintf+0xec/0x1a0 lib/kasprintf.c:25
 kobject_set_name_vargs+0x61/0x110 lib/kobject.c:274
 dev_set_name+0xe3/0x140 drivers/base/core.c:3488
 usb_add_gadget+0x475/0x6f0 drivers/usb/gadget/udc/core.c:1448
 usb_add_gadget_udc_release+0x19c/0x1f0 drivers/usb/gadget/udc/core.c:1506
 dummy_udc_probe+0x68a/0x780 drivers/usb/gadget/udc/dummy_hcd.c:1102
 platform_probe+0x13b/0x1c0 drivers/base/platform.c:1376
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:717
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:879
 device_driver_attach+0xe0/0x1d0 drivers/base/dd.c:1206
 bind_store+0x1cc/0x210 drivers/base/bus.c:267
 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2018 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x474/0x9a0 fs/read_write.c:584
 ksys_write+0x151/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 13913:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1811 [inline]
 slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
 slab_free mm/slub.c:3830 [inline]
 __kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
 kobject_cleanup lib/kobject.c:695 [inline]
 kobject_release lib/kobject.c:720 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x260/0x450 lib/kobject.c:737
 platform_remove+0x6d/0xe0 drivers/base/platform.c:1396
 device_remove drivers/base/dd.c:626 [inline]
 __device_release_driver drivers/base/dd.c:1351 [inline]
 device_release_driver_internal+0x408/0x6f0 drivers/base/dd.c:1374
 unbind_store+0x1a1/0x1d0 drivers/base/bus.c:244
 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2018 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x474/0x9a0 fs/read_write.c:584
 ksys_write+0x151/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

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

The buggy address belongs to the physical page:
page:ffffea0000972b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888025cad0a0 pfn:0x25cad
anon flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888017c413c0 0000000000000000 dead000000000001
raw: ffff888025cad0a0 000000008080007f 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5777, tgid 5777 (syz-executor), ts 90861327052, free_ts 90339972923
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
 prep_new_page mm/page_alloc.c:1589 [inline]
 get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
 __alloc_pages_node include/linux/gfp.h:237 [inline]
 alloc_slab_page+0x4f/0x180 mm/slub.c:1883
 allocate_slab mm/slub.c:2028 [inline]
 new_slab+0x87/0x2d0 mm/slub.c:2081
 ___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
 __slab_alloc mm/slub.c:3339 [inline]
 __slab_alloc_node mm/slub.c:3392 [inline]
 slab_alloc_node mm/slub.c:3485 [inline]
 __kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534
 kmalloc_node_trace+0x26/0xe0 mm/slab_common.c:1111
 kmalloc_node include/linux/slab.h:616 [inline]
 kzalloc_node include/linux/slab.h:732 [inline]
 hugetlb_cgroup_css_alloc+0x180/0x880 mm/hugetlb_cgroup.c:161
 css_create kernel/cgroup/cgroup.c:5561 [inline]
 cgroup_apply_control_enable+0x3cc/0xb00 kernel/cgroup/cgroup.c:3219
 cgroup_mkdir+0xc83/0xe70 kernel/cgroup/cgroup.c:5779
 kernfs_iop_mkdir+0x241/0x3e0 fs/kernfs/dir.c:1246
 vfs_mkdir+0x2a5/0x470 fs/namei.c:4125
 do_mkdirat+0x1dc/0x450 fs/namei.c:4148
 __do_sys_mkdirat fs/namei.c:4163 [inline]
 __se_sys_mkdirat fs/namei.c:4161 [inline]
 __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4161
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1182 [inline]
 free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459
 __slab_free+0x35a/0x400 mm/slub.c:3736
 qlink_free mm/kasan/quarantine.c:166 [inline]
 qlist_free_all+0x75/0xd0 mm/kasan/quarantine.c:185
 kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292
 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:306
 kasan_slab_alloc include/linux/kasan.h:188 [inline]
 slab_post_alloc_hook+0x6a/0x4d0 mm/slab.h:770
 slab_alloc_node mm/slub.c:3495 [inline]
 __kmem_cache_alloc_node+0x194/0x250 mm/slub.c:3534
 __do_kmalloc_node mm/slab_common.c:1006 [inline]
 __kmalloc+0xa7/0x240 mm/slab_common.c:1020
 kmalloc_array include/linux/slab.h:637 [inline]
 genl_family_rcv_msg_attrs_parse+0xa3/0x290 net/netlink/genetlink.c:796
 genl_family_rcv_msg_doit+0xcf/0x310 net/netlink/genetlink.c:949
 genl_family_rcv_msg net/netlink/genetlink.c:1051 [inline]
 genl_rcv_msg+0x611/0x7a0 net/netlink/genetlink.c:1066
 netlink_rcv_skb+0x235/0x4c0 net/netlink/af_netlink.c:2550
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1075
 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
 netlink_unicast+0x7b1/0x930 net/netlink/af_netlink.c:1346
 netlink_sendmsg+0x8d0/0xbf0 net/netlink/af_netlink.c:1899

Memory state around the buggy address:
 ffff888025cadd00: 00 01 fc fc fa fb fc fc 00 04 fc fc 00 00 fc fc
 ffff888025cadd80: 00 00 fc fc 00 00 fc fc 00 00 fc fc fa fb fc fc
>ffff888025cade00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
                   ^
 ffff888025cade80: fa fb fc fc 00 00 fc fc fa fb fc fc fa fb fc fc
 ffff888025cadf00: fa fb fc fc 00 00 fc fc fa fb fc fc 00 00 fc fc
==================================================================

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