syzbot


KASAN: use-after-free Read in usb_udc_uevent (3)

Status: premoderation: reported on 2025/08/29 14:57
Reported-by: syzbot+0a0e3471054ba88266b3@syzkaller.appspotmail.com
First crash: 2d20h, last: 2d20h
Similar bugs (11)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in usb_udc_uevent 19 1 645d 645d 0/3 auto-obsoleted due to no activity on 2024/03/05 09:48
android-5-10 KASAN: use-after-free Read in usb_udc_uevent (3) 19 1 379d 379d 0/2 auto-obsoleted due to no activity on 2024/11/16 03:41
android-5-10 KASAN: use-after-free Read in usb_udc_uevent (2) 19 1 808d 808d 0/2 auto-obsoleted due to no activity on 2023/09/13 18:59
android-54 KASAN: use-after-free Read in usb_udc_uevent (2) 19 2 1248d 1263d 0/2 auto-closed as invalid on 2022/07/31 07:22
android-5-15 KASAN: use-after-free Read in usb_udc_uevent 19 1 972d 972d 0/2 auto-obsoleted due to no activity on 2023/04/11 06:40
android-54 KASAN: use-after-free Read in usb_udc_uevent 19 1 1690d 1690d 0/2 auto-closed as invalid on 2021/05/14 11:04
android-54 KASAN: use-after-free Read in usb_udc_uevent (3) 19 2 965d 1004d 0/2 auto-obsoleted due to no activity on 2023/05/09 15:23
upstream KASAN: use-after-free Read in usb_udc_uevent usb 19 syz error 30 1130d 1916d 22/29 fixed on 2023/02/24 13:50
android-5-10 KASAN: use-after-free Read in usb_udc_uevent 19 2 933d 957d 0/2 auto-obsoleted due to no activity on 2023/05/11 18:44
android-54 KASAN: use-after-free Read in usb_udc_uevent (4) 19 1 591d 591d 0/2 auto-obsoleted due to no activity on 2024/04/18 10:07
android-5-15 KASAN: use-after-free Read in usb_udc_uevent (2) 19 1 144d 144d 0/2 auto-obsoleted due to no activity on 2025/07/09 03:40

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in usb_udc_uevent+0xb2/0x120 drivers/usb/gadget/udc/core.c:1765
Read of size 8 at addr ffff88811284c010 by task udevd/101

CPU: 1 PID: 101 Comm: udevd Not tainted 5.15.189-syzkaller-android13-5.15.189_r00 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:88
 dump_stack_lvl+0xee/0x150 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+0xf1/0x140 mm/kasan/report.c:444
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
 usb_udc_uevent+0xb2/0x120 drivers/usb/gadget/udc/core.c:1765
 dev_uevent+0x3dd/0x4e0 drivers/base/core.c:2362
 uevent_show+0x1b9/0x330 drivers/base/core.c:2420
 dev_attr_show+0x56/0xd0 drivers/base/core.c:2120
 sysfs_kf_seq_show+0x266/0x3d0 fs/sysfs/file.c:61
 kernfs_seq_show+0x119/0x160 fs/kernfs/file.c:168
 seq_read_iter+0x490/0xd30 fs/seq_file.c:230
 kernfs_fop_read_iter+0x147/0x470 fs/kernfs/file.c:241
 call_read_iter include/linux/fs.h:2206 [inline]
 new_sync_read fs/read_write.c:404 [inline]
 vfs_read+0x68b/0xbe0 fs/read_write.c:485
 ksys_read+0x140/0x240 fs/read_write.c:623
 __do_sys_read fs/read_write.c:633 [inline]
 __se_sys_read fs/read_write.c:631 [inline]
 __x64_sys_read+0x7b/0x90 fs/read_write.c:631
 x64_sys_call+0x96d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:1
 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:0x7fd163f2e407
Code: 48 89 fa 4c 89 df e8 38 aa 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:00007ffd9bc30440 EFLAGS: 00000202 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007fd163e40880 RCX: 00007fd163f2e407
RDX: 0000000000001000 RSI: 000056007b49d680 RDI: 000000000000000c
RBP: 00007fd164076ff0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000000a
R13: 00007fd164076ea0 R14: 0000000000000000 R15: 000056007b4997f0
 </TASK>

Allocated by task 2865:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:433 [inline]
 ____kasan_kmalloc mm/kasan/common.c:512 [inline]
 __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:521
 kasan_kmalloc include/linux/kasan.h:227 [inline]
 kmem_cache_alloc_trace+0x119/0x270 mm/slub.c:3269
 kmalloc include/linux/slab.h:616 [inline]
 kzalloc include/linux/slab.h:747 [inline]
 dev_new drivers/usb/gadget/legacy/raw_gadget.c:191 [inline]
 raw_open+0x8b/0x3d0 drivers/usb/gadget/legacy/raw_gadget.c:387
 misc_open+0x308/0x380 drivers/char/misc.c:141
 chrdev_open+0x597/0x670 fs/char_dev.c:414
 do_dentry_open+0x834/0x1010 fs/open.c:828
 vfs_open+0x73/0x80 fs/open.c:958
 do_open fs/namei.c:3608 [inline]
 path_openat+0x2646/0x2f10 fs/namei.c:3742
 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769
 do_sys_openat2+0x14c/0x7b0 fs/open.c:1234
 do_sys_open fs/open.c:1250 [inline]
 __do_sys_openat fs/open.c:1266 [inline]
 __se_sys_openat fs/open.c:1261 [inline]
 __x64_sys_openat+0x136/0x160 fs/open.c:1261
 x64_sys_call+0x219/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258
 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

Freed by task 2859:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
 kasan_slab_free include/linux/kasan.h:193 [inline]
 slab_free_hook mm/slub.c:1723 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1749
 slab_free mm/slub.c:3521 [inline]
 kfree+0xc4/0x270 mm/slub.c:4583
 dev_free+0x71c/0x7c0 drivers/usb/gadget/legacy/raw_gadget.c:227
 kref_put include/linux/kref.h:65 [inline]
 raw_release+0x19f/0x270 drivers/usb/gadget/legacy/raw_gadget.c:426
 __fput+0x20b/0x8b0 fs/file_table.c:311
 ____fput+0x15/0x20 fs/file_table.c:339
 task_work_run+0x127/0x190 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0xa7e/0x27a0 kernel/exit.c:889
 do_group_exit+0x141/0x310 kernel/exit.c:1003
 get_signal+0x66a/0x1480 kernel/signal.c:2907
 arch_do_signal_or_restart+0xc1/0x10f0 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:154 [inline]
 exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:178
 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88811284c000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 16 bytes inside of
 4096-byte region [ffff88811284c000, ffff88811284d000)
The buggy address belongs to the page:
page:ffffea00044a1200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x112848
head:ffffea00044a1200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043380
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 1414, ts 129170716570, free_ts 128870097725
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611
 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485
 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5795
 alloc_slab_page mm/slub.c:-1 [inline]
 allocate_slab mm/slub.c:1932 [inline]
 new_slab+0xa1/0x4d0 mm/slub.c:1995
 ___slab_alloc+0x381/0x810 mm/slub.c:3028
 __slab_alloc+0x49/0x90 mm/slub.c:3115
 slab_alloc_node mm/slub.c:3206 [inline]
 slab_alloc mm/slub.c:3250 [inline]
 kmem_cache_alloc_trace+0x146/0x270 mm/slub.c:3267
 kmalloc include/linux/slab.h:616 [inline]
 kzalloc include/linux/slab.h:747 [inline]
 snmp6_alloc_dev net/ipv6/addrconf.c:359 [inline]
 ipv6_add_dev+0x5e5/0x1150 net/ipv6/addrconf.c:409
 addrconf_notify+0x582/0xde0 net/ipv6/addrconf.c:3597
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2057 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2069 [inline]
 call_netdevice_notifiers+0x111/0x190 net/core/dev.c:2083
 register_netdevice+0x1039/0x13a0 net/core/dev.c:10436
 __ip_tunnel_create+0x2bf/0x380 net/ipv4/ip_tunnel.c:267
 ip_tunnel_init_net+0x290/0x740 net/ipv4/ip_tunnel.c:1084
 erspan_init_net+0x29/0x30 net/ipv4/ip_gre.c:1723
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1472 [inline]
 free_pcp_prepare mm/page_alloc.c:1544 [inline]
 free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534
 free_unref_page+0xa2/0x550 mm/page_alloc.c:3616
 free_the_page mm/page_alloc.c:805 [inline]
 __free_pages+0x6c/0x100 mm/page_alloc.c:5871
 __free_slab+0xe8/0x1e0 mm/slub.c:2020
 free_slab mm/slub.c:2035 [inline]
 discard_slab mm/slub.c:2041 [inline]
 __unfreeze_partials+0x160/0x190 mm/slub.c:2527
 put_cpu_partial+0xc6/0x120 mm/slub.c:2607
 __slab_free+0x1d4/0x290 mm/slub.c:3390
 do_slab_free mm/slub.c:3509 [inline]
 ___cache_free+0x104/0x120 mm/slub.c:3530
 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/0xf0 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:3240 [inline]
 slab_alloc mm/slub.c:3250 [inline]
 kmem_cache_alloc+0xf7/0x260 mm/slub.c:3255
 getname_flags+0xb9/0x500 fs/namei.c:138
 user_path_at_empty+0x30/0x1c0 fs/namei.c:2882

Memory state around the buggy address:
 ffff88811284bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88811284bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88811284c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff88811284c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811284c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/29 14:56 android13-5.15-lts f32b52534f1d 3e1beec6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in usb_udc_uevent
* Struck through repros no longer work on HEAD.