KASAN: use-after-free Read in gadgets_drop

Status: premoderation: reported syz repro on 2026/10/20 01:23
Bug presence: origin:downstream
[Documentation on labels]
Reported-by: syzbot+8f9541fb5879ee50c527@syzkaller.appspotmail.com
First crash: 19d, last: 2h25m
▶ ▼ Bug presence (3)
Date Name Commit Repro Result
2026/11/03 android13-5.15-lts (ToT) 2316d138a3c3 syz [report] KASAN: use-after-free Read in gadgets_drop
2026/11/02 lts (merge base) 792fbe1537d8 syz Didn't crash
2026/11/02 upstream (ToT) 6628e7d4c6b2 syz Didn't crash
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: use-after-free Read in gadgets_drop 19 syz 5 3d20h 27d 0/2 premoderation: reported syz repro on 2026/10/12 14:54
android-6-1 KASAN: use-after-free Read in gadgets_drop 19 syz 7 4d17h 6d06h 0/2 premoderation: reported syz repro on 2026/11/02 12:52

Sample crash report:
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f53cedc0fac R14: 00007f53cedc0fa0 R15: 00007f53cedc0fa0
 </TASK>
==================================================================
BUG: KASAN: use-after-free in android_device_destroy drivers/usb/gadget/configfs.c:1819 [inline]
BUG: KASAN: use-after-free in gadgets_drop+0x40/0xd0 drivers/usb/gadget/configfs.c:1901
Read of size 8 at addr ffff88811a624550 by task syz.2.17/381

CPU: 0 PID: 381 Comm: syz.2.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 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+0x10f/0x150 mm/kasan/report.c:444
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
 android_device_destroy drivers/usb/gadget/configfs.c:1819 [inline]
 gadgets_drop+0x40/0xd0 drivers/usb/gadget/configfs.c:1901
 client_drop_item+0x94/0xc0 fs/configfs/dir.c:962
 configfs_mkdir+0x7f1/0x9c0 fs/configfs/dir.c:1440
 vfs_mkdir+0x38b/0x590 fs/namei.c:4073
 do_mkdirat+0x174/0x4d0 fs/namei.c:4098
 __do_sys_mkdirat fs/namei.c:4113 [inline]
 __se_sys_mkdirat fs/namei.c:4111 [inline]
 __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111
 x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259
 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:0x7f53ceb3ab19
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc667c94d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f53cedc0fa0 RCX: 00007f53ceb3ab19
RDX: 00000000000001ff RSI: 0000200000000540 RDI: ffffffffffffff9c
RBP: 00007f53cebd2b70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f53cedc0fac R14: 00007f53cedc0fa0 R15: 00007f53cedc0fa0
 </TASK>

Allocated by task 381:
 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+0xd4/0x100 mm/kasan/common.c:521
 kasan_kmalloc include/linux/kasan.h:227 [inline]
 kmem_cache_alloc_trace+0x119/0x270 mm/slub.c:3274
 kmalloc include/linux/slab.h:619 [inline]
 kzalloc include/linux/slab.h:750 [inline]
 gadgets_make+0x57/0xa70 drivers/usb/gadget/configfs.c:1839
 configfs_mkdir+0x50a/0x9c0 fs/configfs/dir.c:1356
 vfs_mkdir+0x38b/0x590 fs/namei.c:4073
 do_mkdirat+0x174/0x4d0 fs/namei.c:4098
 __do_sys_mkdirat fs/namei.c:4113 [inline]
 __se_sys_mkdirat fs/namei.c:4111 [inline]
 __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111
 x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259
 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 381:
 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:1728 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754
 slab_free mm/slub.c:3526 [inline]
 kfree+0xc4/0x270 mm/slub.c:4588
 gadget_info_attr_release+0xcb/0xf0 drivers/usb/gadget/configfs.c:429
 config_item_cleanup fs/configfs/item.c:128 [inline]
 config_item_release fs/configfs/item.c:137 [inline]
 kref_put include/linux/kref.h:65 [inline]
 config_item_put+0x158/0x210 fs/configfs/item.c:149
 gadgets_drop+0x23/0xd0 drivers/usb/gadget/configfs.c:1900
 client_drop_item+0x94/0xc0 fs/configfs/dir.c:962
 configfs_mkdir+0x7f1/0x9c0 fs/configfs/dir.c:1440
 vfs_mkdir+0x38b/0x590 fs/namei.c:4073
 do_mkdirat+0x174/0x4d0 fs/namei.c:4098
 __do_sys_mkdirat fs/namei.c:4113 [inline]
 __se_sys_mkdirat fs/namei.c:4111 [inline]
 __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4111
 x64_sys_call+0x37e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259
 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 ffff88811a624000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1360 bytes inside of
 2048-byte region [ffff88811a624000, ffff88811a624800)
The buggy address belongs to the page:
page:ffffea0004698800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11a620
head:ffffea0004698800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043200
raw: 0000000000000000 0000000000080008 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 123, ts 6312989300, free_ts 0
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2610
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2616
 get_page_from_freelist+0x2d42/0x2dd0 mm/page_alloc.c:4492
 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5829
 alloc_slab_page mm/slub.c:-1 [inline]
 allocate_slab mm/slub.c:1937 [inline]
 new_slab+0xa0/0x4d0 mm/slub.c:2000
 ___slab_alloc+0x3ac/0x840 mm/slub.c:3033
 __slab_alloc+0x49/0x90 mm/slub.c:3120
 slab_alloc_node mm/slub.c:3211 [inline]
 slab_alloc mm/slub.c:3255 [inline]
 __kmalloc_track_caller+0x169/0x2c0 mm/slub.c:4954
 kmalloc_reserve net/core/skbuff.c:357 [inline]
 __alloc_skb+0x210/0x730 net/core/skbuff.c:428
 alloc_skb include/linux/skbuff.h:1183 [inline]
 nlmsg_new include/net/netlink.h:953 [inline]
 audit_buffer_alloc kernel/audit.c:1806 [inline]
 audit_log_start+0x407/0x8a0 kernel/audit.c:1924
 common_lsm_audit+0xd2/0x1670 security/lsm_audit.c:457
 slow_avc_audit+0x1c4/0x240 security/selinux/avc.c:802
 avc_audit security/selinux/include/avc.h:135 [inline]
 avc_has_perm+0x1fb/0x250 security/selinux/avc.c:1193
 file_has_perm+0x1a8/0x700 security/selinux/hooks.c:1785
 match_file+0xc8/0x130 security/selinux/hooks.c:2474
 iterate_fd+0x113/0x1e0 fs/file.c:1324
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88811a624400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811a624480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811a624500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff88811a624580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811a624600: 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/11/08 16:56 android13-5.15-lts 2316d138a3c3 5cecaf1f .config strace log report syz / log [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in gadgets_drop
2026/10/20 02:28 android13-5.15-lts 86eefba284ca 72cdc28d .config strace log report syz / log [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in gadgets_drop
2026/10/20 02:08 android13-5.15-lts 86eefba284ca 72cdc28d .config strace log report syz / log [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in gadgets_drop
2026/10/20 01:49 android13-5.15-lts 86eefba284ca 72cdc28d .config strace log report syz / log [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in gadgets_drop
2026/10/20 01:23 android13-5.15-lts 86eefba284ca 72cdc28d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in gadgets_drop
2026/10/20 01:22 android13-5.15-lts 86eefba284ca 72cdc28d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in gadgets_drop
* Struck through repros no longer work on HEAD.