KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname

Status: upstream: reported C repro on 2026/08/04 16:29
Reported-by: syzbot+d9853da77b650b04f8c0@syzkaller.appspotmail.com
First crash: 28d, last: 3h23m
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 8 5d21h 25d 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 ffff88801d253220 by task cifsd/4628

CPU: 0 PID: 4628 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 4627:
 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:1584
 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 4627:
 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:1584
 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 ffff88801d253220
 which belongs to the cache kmalloc-16 of size 16
The buggy address is located 0 bytes inside of
 16-byte region [ffff88801d253220, ffff88801d253230)

The buggy address belongs to the physical page:
page:ffffea00007494c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d253
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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 2929633689, free_ts 0
 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_page_interleave+0x24/0x1e0 mm/mempolicy.c:2115
 alloc_slab_page+0x5d/0x180 mm/slub.c:1799
 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
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc_node_track_caller+0xa0/0x240 mm/slab_common.c:956
 __do_krealloc mm/slab_common.c:1336 [inline]
 krealloc+0x6a/0x100 mm/slab_common.c:1369
 add_sysfs_param+0x169/0x920 kernel/params.c:654
 kernel_add_sysfs_param+0xaf/0x11b kernel/params.c:798
 param_sysfs_builtin+0x20d/0x2ae kernel/params.c:837
 param_sysfs_init+0x66/0x6a kernel/params.c:958
 do_one_initcall+0x257/0x800 init/main.c:1270
 do_initcall_level+0x13d/0x1ed init/main.c:1343
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88801d253100: 00 04 fc fc 00 00 fc fc 00 00 fc fc fa fb fc fc
 ffff88801d253180: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
>ffff88801d253200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
                               ^
 ffff88801d253280: 00 01 fc fc 00 01 fc fc fa fb fc fc fa fb fc fc
 ffff88801d253300: fa fb fc fc fa fb fc fc 00 02 fc fc 00 02 fc fc
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/30 00:27 linux-6.1.y d64a499eea6b 2f52988a .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname
2026/08/29 20:40 linux-6.1.y d64a499eea6b 2f52988a .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 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
2026/09/02 11:36 linux-6.1.y d64a499eea6b 587f6b29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname
* Struck through repros no longer work on HEAD.