Hello,
syzbot found the following issue on:
HEAD commit: ae068b676196 Linux 6.6.146
git tree: linux-6.6.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=11492c7f980000
kernel config:
https://syzkaller.appspot.com/x/.config?x=f0bc3d90c30838b5
dashboard link:
https://syzkaller.appspot.com/bug?extid=4f47b6d1af962ba37822
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/e522c100cfc5/disk-ae068b67.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/578f09f7caef/vmlinux-ae068b67.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/1693245754f4/bzImage-ae068b67.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+4f47b6...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: slab-use-after-free in gphonet_set_gadget drivers/usb/gadget/function/f_phonet.c:720 [inline]
BUG: KASAN: slab-use-after-free in pn_bind+0x106/0xb10 drivers/usb/gadget/function/f_phonet.c:510
Write of size 8 at addr ffff8880785a06e8 by task syz.3.1627/12838
CPU: 0 PID: 12838 Comm: syz.3.1627 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
gphonet_set_gadget drivers/usb/gadget/function/f_phonet.c:720 [inline]
pn_bind+0x106/0xb10 drivers/usb/gadget/function/f_phonet.c:510
usb_add_function+0x2dd/0x980 drivers/usb/gadget/composite.c:333
configfs_composite_bind+0xde4/0x13f0 drivers/usb/gadget/configfs.c:1800
gadget_bind_driver+0x2b3/0x770 drivers/usb/gadget/udc/core.c:1651
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
driver_probe_device+0x4f/0x420 drivers/base/dd.c:909
__driver_attach+0x444/0x6d0 drivers/base/dd.c:1295
bus_for_each_dev+0x235/0x2b0 drivers/base/bus.c:370
bus_add_driver+0x340/0x630 drivers/base/bus.c:723
driver_register+0x23a/0x310 drivers/base/driver.c:246
usb_gadget_register_driver_owner+0xf9/0x270 drivers/usb/gadget/udc/core.c:1730
gadget_dev_desc_UDC_store+0x1c7/0x2e0 drivers/usb/gadget/configfs.c:300
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x312/0x400 fs/configfs/file.c:229
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
RIP: 0033:0x7f250e19df99
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:00007f250ef94028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f250e426090 RCX: 00007f250e19df99
RDX: 000000000000000c RSI: 00002000000004c0 RDI: 0000000000000004
RBP: 00007f250e234ec4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f250e426128 R14: 00007f250e426090 R15: 00007ffe686f89e8
</TASK>
Allocated by task 5142:
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+0xb6/0x240 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
kvmalloc_node+0x70/0x180 mm/util.c:617
kvmalloc include/linux/slab.h:738 [inline]
seq_buf_alloc fs/seq_file.c:38 [inline]
seq_read_iter+0x1e2/0xc50 fs/seq_file.c:210
call_read_iter include/linux/fs.h:2012 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x486/0x990 fs/read_write.c:470
ksys_read+0x151/0x260 fs/read_write.c:613
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 ffff8880785a0000
which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 1768 bytes inside of
freed 4096-byte region [ffff8880785a0000, ffff8880785a1000)
The buggy address belongs to the physical page:
page:ffffea0001e16800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880785a0000 pfn:0x785a0
head:ffffea0001e16800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88805d29d5c1
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017c4f500 ffffea0001755210 ffffea0001950410
raw: ffff8880785a0000 0000000000040002 00000001ffffffff ffff88805d29d5c1
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 5142, tgid 5142 (udevd), ts 41373744175, free_ts 33841047772
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_slab_page+0x5d/0x180 mm/slub.c:1881
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
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node+0xa6/0x240 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
kvmalloc_node+0x70/0x180 mm/util.c:617
kvmalloc include/linux/slab.h:738 [inline]
seq_buf_alloc fs/seq_file.c:38 [inline]
seq_read_iter+0x1e2/0xc50 fs/seq_file.c:210
call_read_iter include/linux/fs.h:2012 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x486/0x990 fs/read_write.c:470
ksys_read+0x151/0x260 fs/read_write.c:613
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
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
free_contig_range+0xa1/0x150 mm/page_alloc.c:6421
destroy_args+0x7d/0x840 mm/debug_vm_pgtable.c:1015
debug_vm_pgtable+0x411/0x440 mm/debug_vm_pgtable.c:1400
do_one_initcall+0x242/0x790 init/main.c:1249
do_initcall_level+0x13d/0x1f0 init/main.c:1311
do_initcalls+0x69/0xd0 init/main.c:1327
kernel_init_freeable+0x3d9/0x560 init/main.c:1564
kernel_init+0x1d/0x1c0 init/main.c:1454
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
Memory state around the buggy address:
ffff8880785a0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880785a0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880785a0680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880785a0700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880785a0780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
---
This report is generated by a bot. It may contain errors.
See
https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup