KASAN: use-after-free Read in android_work

Status: premoderation: reported on 2026/07/30 10:01
Reported-by: syzbot+4fdb2e55720d5395cb0e@syzkaller.appspotmail.com
First crash: 2d11h, last: 2d11h
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-12 KASAN: slab-use-after-free Read in android_work 19 1 1d21h 1d21h 0/1 premoderation: reported on 2026/07/31 00:15

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in kobject_uevent_env+0xc2/0x720 lib/kobject_uevent.c:497
Read of size 8 at addr ffff888113ddc820 by task kworker/0:1/19

CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: events android_work
Call Trace:
 <TASK>
 __dump_stack+0x21/0x24 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x71/0x200 mm/kasan/report.c:316
 print_report+0x4a/0x60 mm/kasan/report.c:420
 kasan_report+0x122/0x150 mm/kasan/report.c:524
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:351
 kobject_uevent_env+0xc2/0x720 lib/kobject_uevent.c:497
 android_work+0x2fa/0x4c0 drivers/usb/gadget/configfs.c:1504
 process_one_work+0x717/0xc30 kernel/workqueue.c:2302
 worker_thread+0xa4d/0x11d0 kernel/workqueue.c:2449
 kthread+0x281/0x320 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 335:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:380 [inline]
 __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:389
 kasan_kmalloc include/linux/kasan.h:212 [inline]
 kmalloc_trace+0x40/0xb0 mm/slab_common.c:1033
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 device_create_groups_vargs drivers/base/core.c:4374 [inline]
 device_create+0x13a/0x300 drivers/base/core.c:4434
 android_device_create drivers/usb/gadget/configfs.c:1784 [inline]
 gadgets_make+0x84a/0xad0 drivers/usb/gadget/configfs.c:1886
 configfs_mkdir+0x518/0x9e0 fs/configfs/dir.c:1329
 vfs_mkdir+0x39c/0x580 fs/namei.c:4113
 do_mkdirat+0x174/0x4d0 fs/namei.c:4138
 __do_sys_mkdir fs/namei.c:4158 [inline]
 __se_sys_mkdir fs/namei.c:4156 [inline]
 __x64_sys_mkdir+0x6e/0x80 fs/namei.c:4156
 x64_sys_call+0x966/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:84
 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

Freed by task 367:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:242
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:250
 kasan_slab_free include/linux/kasan.h:178 [inline]
 slab_free_hook mm/slub.c:1750 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1776
 slab_free mm/slub.c:3712 [inline]
 __kmem_cache_free+0xb7/0x1b0 mm/slub.c:3728
 kfree+0x6f/0xf0 mm/slab_common.c:990
 device_create_release+0x15/0x20 drivers/base/core.c:4359
 device_release+0xa4/0x1d0 drivers/base/core.c:-1
 kobject_cleanup lib/kobject.c:681 [inline]
 kobject_release lib/kobject.c:712 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x19d/0x280 lib/kobject.c:729
 put_device drivers/base/core.c:3806 [inline]
 device_unregister drivers/base/core.c:3930 [inline]
 device_destroy+0xb4/0xf0 drivers/base/core.c:4500
 android_device_destroy drivers/usb/gadget/configfs.c:1816 [inline]
 gadgets_drop+0xa0/0xd0 drivers/usb/gadget/configfs.c:1904
 client_drop_item fs/configfs/dir.c:933 [inline]
 configfs_rmdir+0x89b/0x980 fs/configfs/dir.c:1536
 vfs_rmdir+0x381/0x4f0 fs/namei.c:4198
 do_rmdir+0x261/0x6b0 fs/namei.c:4259
 __do_sys_rmdir fs/namei.c:4278 [inline]
 __se_sys_rmdir fs/namei.c:4276 [inline]
 __x64_sys_rmdir+0x49/0x50 fs/namei.c:4276
 x64_sys_call+0x68e/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:85
 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 ffff888113ddc800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 32 bytes inside of
 1024-byte region [ffff888113ddc800, ffff888113ddcc00)

The buggy address belongs to the physical page:
page:ffffea00044f7600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x113dd8
head:ffffea00044f7600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea00044f4800 dead000000000002 ffff888100043080
raw: 0000000000000000 0000000000100010 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 102, tgid 102 (udevd), ts 5743405029, free_ts 0
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2672
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2679
 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4586
 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5930
 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
 allocate_slab mm/slub.c:1967 [inline]
 new_slab+0x98/0x3e0 mm/slub.c:2020
 ___slab_alloc+0x70f/0xb70 mm/slub.c:3177
 __slab_alloc+0x5e/0xa0 mm/slub.c:3263
 slab_alloc_node mm/slub.c:3348 [inline]
 __kmem_cache_alloc_node+0x204/0x2d0 mm/slub.c:3423
 __do_kmalloc_node mm/slab_common.c:937 [inline]
 __kmalloc_node_track_caller+0xa1/0x1e0 mm/slab_common.c:958
 kmalloc_reserve net/core/skbuff.c:449 [inline]
 __alloc_skb+0x226/0x4a0 net/core/skbuff.c:518
 alloc_skb include/linux/skbuff.h:1322 [inline]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1183 [inline]
 netlink_sendmsg+0x635/0xbd0 net/netlink/af_netlink.c:1848
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 ____sys_sendmsg+0x5fb/0x9c0 net/socket.c:2508
 ___sys_sendmsg+0x2a2/0x360 net/socket.c:2562
 __sys_sendmsg net/socket.c:2591 [inline]
 __do_sys_sendmsg net/socket.c:2600 [inline]
 __se_sys_sendmsg net/socket.c:2598 [inline]
 __x64_sys_sendmsg+0x20d/0x2e0 net/socket.c:2598
 x64_sys_call+0x171/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888113ddc700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888113ddc780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888113ddc800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
 ffff888113ddc880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888113ddc900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
android_work: sent uevent USB_STATE=CONFIGURED
usb 5-1: USB disconnect, device number 2

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/30 10:00 android14-6.1 92668decd5e0 2377cd3d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in android_work
* Struck through repros no longer work on HEAD.