KASAN: use-after-free Read in ep_open

Status: upstream: reported C repro on 2026/08/23 02:59
Reported-by: syzbot+670851518c52e3b9c082@syzkaller.appspotmail.com
First crash: 8d16h, last: 7d04h
Bug presence (1)
Date Name Commit Repro Result
2026/08/25 upstream (ToT) 66498c75b4f8 C Failed due to an error; will retry later
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in ep_open 19 syz, C 7 8d13h 16d 0/3 upstream: reported C repro on 2026/08/14 19:28
upstream KASAN: slab-use-after-free Read in ep_open prio:normal usb 19 syz, C done 98 17h24m 31d 0/29 upstream: reported C repro on 2026/07/31 01:28
linux-6.6 KASAN: slab-use-after-free Read in ep_open 19 syz, C 8 8d14h 30d 0/2 upstream: reported C repro on 2026/08/01 12:04

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __mutex_lock_common+0x118/0x2400 kernel/locking/mutex.c:575
Read of size 8 at addr ffff888073d79060 by task syz-executor/4318

CPU: 0 PID: 4318 Comm: syz-executor 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/0x250 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 __mutex_lock_common+0x118/0x2400 kernel/locking/mutex.c:575
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_interruptible_nested+0x17/0x20 kernel/locking/mutex.c:765
 ep_open+0x4a/0x260 drivers/usb/gadget/legacy/inode.c:822
 do_dentry_open+0x7f7/0xf90 fs/open.c:826
 do_open fs/namei.c:3616 [inline]
 path_openat+0x2718/0x2fb0 fs/namei.c:3750
 do_filp_open+0x1df/0x400 fs/namei.c:3777
 do_sys_openat2+0x14b/0x500 fs/open.c:1255
 do_sys_open fs/open.c:1271 [inline]
 __do_sys_openat fs/open.c:1287 [inline]
 __se_sys_openat fs/open.c:1282 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1282
 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:0x7fc98a65190e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007ffc846bac88 EFLAGS: 00000246
 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 000055556ca6a500 RCX: 00007fc98a65190e
RDX: 0000000000000000 RSI: 00007ffc846badf0 RDI: ffffffffffffff9c
RBP: 00007ffc846badf0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc846bbee0
R13: 00007fc98a727474 R14: 000055556ca6a4e8 R15: 0000000000000006
 </TASK>

Allocated by task 4420:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:607 [inline]
 kzalloc include/linux/slab.h:738 [inline]
 activate_ep_files drivers/usb/gadget/legacy/inode.c:1599 [inline]
 gadgetfs_bind+0x25b/0x820 drivers/usb/gadget/legacy/inode.c:1690
 udc_bind_to_driver+0x203/0x5f0 drivers/usb/gadget/udc/core.c:1574
 usb_gadget_probe_driver+0x1fb/0x380 drivers/usb/gadget/udc/core.c:1637
 dev_config+0xe3c/0x1250 drivers/usb/gadget/legacy/inode.c:1881
 vfs_write+0x304/0xd70 fs/read_write.c:592
 ksys_write+0x153/0x260 fs/read_write.c:647
 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 4423:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1710 [inline]
 slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736
 slab_free mm/slub.c:3504 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4564
 destroy_ep_files+0x280/0x340 drivers/usb/gadget/legacy/inode.c:1574
 gadgetfs_unbind+0x105/0x2a0 drivers/usb/gadget/legacy/inode.c:1653
 usb_gadget_remove_driver+0x15c/0x350 drivers/usb/gadget/udc/core.c:1495
 usb_gadget_unregister_driver+0x15d/0x4c0 drivers/usb/gadget/udc/core.c:1654
 dev_release+0x82/0x1f0 drivers/usb/gadget/legacy/inode.c:1197
 __fput+0x212/0x8c0 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0x635/0x2110 kernel/exit.c:890
 __do_sys_exit kernel/exit.c:973 [inline]
 __se_sys_exit kernel/exit.c:971 [inline]
 __x64_sys_exit+0x3c/0x40 kernel/exit.c:971
 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

The buggy address belongs to the object at ffff888073d79000
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 96 bytes inside of
 512-byte region [ffff888073d79000, ffff888073d79200)
The buggy address belongs to the page:
page:ffffea0001cf5e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73d78
head:ffffea0001cf5e00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888016c41c80
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4314, ts 107353283235, free_ts 107132031062
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
 alloc_slab_page mm/slub.c:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x807/0xdd0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 __kmalloc_node_track_caller+0x13d/0x3a0 mm/slub.c:4963
 kmalloc_reserve net/core/skbuff.c:356 [inline]
 __alloc_skb+0x22c/0x750 net/core/skbuff.c:427
 alloc_skb include/linux/skbuff.h:1162 [inline]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1178 [inline]
 netlink_sendmsg+0x654/0xbe0 net/netlink/af_netlink.c:1894
 sock_sendmsg_nosec net/socket.c:706 [inline]
 __sock_sendmsg net/socket.c:718 [inline]
 __sys_sendto+0x46d/0x620 net/socket.c:2073
 __do_sys_sendto net/socket.c:2085 [inline]
 __se_sys_sendto net/socket.c:2081 [inline]
 __x64_sys_sendto+0xda/0xf0 net/socket.c:2081
 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
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
 __vunmap+0x8e0/0xa80 mm/vmalloc.c:2628
 kcov_put kernel/kcov.c:417 [inline]
 kcov_close+0x27/0x50 kernel/kcov.c:519
 __fput+0x212/0x8c0 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0x635/0x2110 kernel/exit.c:890
 do_group_exit+0x12c/0x2f0 kernel/exit.c:1004
 get_signal+0x7eb/0x12e0 kernel/signal.c:2909
 arch_do_signal_or_restart+0xe6/0x12a0 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:154 [inline]
 exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff888073d78f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888073d78f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888073d79000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff888073d79080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888073d79100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/23 04:51 linux-5.15.y 0eb903b5b519 1e72964b .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ep_open
2026/08/23 11:42 linux-5.15.y 0eb903b5b519 1e72964b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ep_open
2026/08/23 09:08 linux-5.15.y 0eb903b5b519 1e72964b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ep_open
2026/08/23 06:58 linux-5.15.y 0eb903b5b519 1e72964b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ep_open
2026/08/24 15:11 linux-5.15.y 945fa863f02c b55bd4c3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ep_open
2026/08/23 02:59 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ep_open
* Struck through repros no longer work on HEAD.