KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname

Status: upstream: reported on 2026/08/04 16:29
Reported-by: syzbot+d9853da77b650b04f8c0@syzkaller.appspotmail.com
First crash: 9d03h, last: 6d02h
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname 19 syz, C 5 22h40m 6d03h 0/3 upstream: reported C repro on 2026/08/07 16:20

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:643 [inline]
BUG: KASAN: use-after-free in string+0x204/0x290 lib/vsprintf.c:725
Read of size 1 at addr ffff88801cb23c00 by task cifsd/7274

CPU: 1 PID: 7274 Comm: cifsd 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/0x24e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:420
 kasan_report+0x10b/0x140 mm/kasan/report.c:524
 string_nocheck lib/vsprintf.c:643 [inline]
 string+0x204/0x290 lib/vsprintf.c:725
 vsnprintf+0x10db/0x1c20 lib/vsprintf.c:2805
 vscnprintf lib/vsprintf.c:2911 [inline]
 scnprintf+0xfb/0x180 lib/vsprintf.c:2964
 reconn_set_ipaddr_from_hostname+0x152/0x600 fs/smb/client/connect.c:111
 __cifs_reconnect+0x1a5/0x870 fs/smb/client/connect.c:444
 cifs_reconnect+0x231/0xd20 fs/smb/client/connect.c:618
 cifs_readv_from_socket+0x782/0x8d0 include/linux/spinlock.h:-1
 cifs_read_from_socket fs/smb/client/connect.c:822 [inline]
 cifs_demultiplex_thread+0x523/0x35b0 fs/smb/client/connect.c:1232
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 7273:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc_node_track_caller+0xb0/0x240 mm/slab_common.c:956
 kstrdup+0x37/0x70 mm/util.c:61
 cifs_get_tcp_session+0xea/0x1ad0 fs/smb/client/connect.c:1740
 mount_get_conns+0xb6/0xec0 fs/smb/client/connect.c:3367
 is_dfs_mount fs/smb/client/connect.c:3746 [inline]
 cifs_mount+0x16a/0x13c0 fs/smb/client/connect.c:3951
 cifs_smb3_do_mount+0x366/0x760 fs/smb/client/cifsfs.c:948
 smb3_get_tree_common fs/smb/client/fs_context.c:712 [inline]
 smb3_get_tree+0x5a1/0xa90 fs/smb/client/fs_context.c:732
 vfs_get_tree+0x88/0x270 fs/super.c:1573
 do_new_mount+0x247/0xa40 fs/namespace.c:3078
 do_mount fs/namespace.c:3421 [inline]
 __do_sys_mount fs/namespace.c:3629 [inline]
 __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3606
 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 7273:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1729 [inline]
 slab_free_freelist_hook+0x133/0x1b0 mm/slub.c:1755
 slab_free mm/slub.c:3687 [inline]
 __kmem_cache_free+0xb6/0x200 mm/slub.c:3700
 cifs_put_tcp_session+0x319/0x400 fs/smb/client/connect.c:1712
 mount_put_conns+0xb0/0x270 fs/smb/client/connect.c:3348
 cifs_mount+0x1097/0x13c0 fs/smb/client/connect.c:4000
 cifs_smb3_do_mount+0x366/0x760 fs/smb/client/cifsfs.c:948
 smb3_get_tree_common fs/smb/client/fs_context.c:712 [inline]
 smb3_get_tree+0x5a1/0xa90 fs/smb/client/fs_context.c:732
 vfs_get_tree+0x88/0x270 fs/super.c:1573
 do_new_mount+0x247/0xa40 fs/namespace.c:3078
 do_mount fs/namespace.c:3421 [inline]
 __do_sys_mount fs/namespace.c:3629 [inline]
 __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3606
 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 ffff88801cb23c00
 which belongs to the cache kmalloc-16 of size 16
The buggy address is located 0 bytes inside of
 16-byte region [ffff88801cb23c00, ffff88801cb23c10)

The buggy address belongs to the physical page:
page:ffffea000072c8c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1cb23
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000001 ffff8880174413c0
raw: 0000000000000000 0000000000800080 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 4277, tgid 4277 (syz-executor), ts 75439730797, free_ts 75317927350
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2560
 prep_new_page mm/page_alloc.c:2567 [inline]
 get_page_from_freelist+0x206b/0x2180 mm/page_alloc.c:4358
 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5658
 __alloc_pages_node include/linux/gfp.h:237 [inline]
 alloc_slab_page+0x4f/0x180 mm/slub.c:1801
 allocate_slab mm/slub.c:1944 [inline]
 new_slab+0x87/0x2d0 mm/slub.c:1997
 ___slab_alloc+0xbc5/0x1240 mm/slub.c:3154
 __slab_alloc mm/slub.c:3240 [inline]
 slab_alloc_node mm/slub.c:3325 [inline]
 __kmem_cache_alloc_node+0x126/0x270 mm/slub.c:3398
 kmalloc_node_trace+0x22/0xe0 mm/slab_common.c:1039
 kmalloc_node include/linux/slab.h:585 [inline]
 kzalloc_node include/linux/slab.h:710 [inline]
 hugetlb_cgroup_css_alloc+0x17c/0x880 mm/hugetlb_cgroup.c:161
 css_create kernel/cgroup/cgroup.c:5570 [inline]
 cgroup_apply_control_enable+0x3cc/0xb00 kernel/cgroup/cgroup.c:3283
 cgroup_mkdir+0xc7f/0xe70 kernel/cgroup/cgroup.c:5789
 kernfs_iop_mkdir+0x23d/0x3d0 fs/kernfs/dir.c:1221
 vfs_mkdir+0x386/0x570 fs/namei.c:4114
 do_mkdirat+0x1d8/0x440 fs/namei.c:4139
 __do_sys_mkdirat fs/namei.c:4154 [inline]
 __se_sys_mkdirat fs/namei.c:4152 [inline]
 __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4152
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1487 [inline]
 free_pcp_prepare mm/page_alloc.c:1537 [inline]
 free_unref_page_prepare+0x8e5/0x9e0 mm/page_alloc.c:3414
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3509
 free_slab mm/slub.c:2036 [inline]
 discard_slab mm/slub.c:2042 [inline]
 __unfreeze_partials+0x188/0x1e0 mm/slub.c:2591
 put_cpu_partial+0x17c/0x250 mm/slub.c:2667
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:306
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x4b/0x490 mm/slab.h:737
 slab_alloc_node mm/slub.c:3359 [inline]
 slab_alloc mm/slub.c:3367 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3374 [inline]
 kmem_cache_alloc+0x18b/0x2f0 mm/slub.c:3383
 getname_flags+0xb7/0x500 fs/namei.c:139
 getname fs/namei.c:218 [inline]
 __do_sys_rename fs/namei.c:5081 [inline]
 __se_sys_rename fs/namei.c:5079 [inline]
 __x64_sys_rename+0x5b/0x90 fs/namei.c:5079
 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

Memory state around the buggy address:
 ffff88801cb23b00: 00 00 fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
 ffff88801cb23b80: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
>ffff88801cb23c00: fa fb fc fc 00 00 fc fc 00 00 fc fc fa fb fc fc
                   ^
 ffff88801cb23c80: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
 ffff88801cb23d00: fa fb fc fc 00 06 fc fc 00 00 fc fc fa fb fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/07 17:56 linux-6.1.y e4f7d8be268e e4ef95d6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname
2026/08/07 02:07 linux-6.1.y 03f3a99e8e93 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname
2026/08/04 16:28 linux-6.1.y fb28aa725e05 d4abbeac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname
* Struck through repros no longer work on HEAD.