[v6.1] KASAN: use-after-free Read in reconn_set_ipaddr_from_hostname

5 views
Skip to first unread message

syzbot

unread,
Aug 4, 2026, 12:29:30 PM (4 days ago) Aug 4
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: fb28aa725e05 Linux 6.1.180
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=162aacc6580000
kernel config: https://syzkaller.appspot.com/x/.config?x=31dfefc4a14efea3
dashboard link: https://syzkaller.appspot.com/bug?extid=d9853da77b650b04f8c0
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/9a6fe2a54d0f/disk-fb28aa72.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/742b23a1d931/vmlinux-fb28aa72.xz
kernel image: https://storage.googleapis.com/syzbot-assets/b3f257c16d2e/bzImage-fb28aa72.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d9853d...@syzkaller.appspotmail.com

==================================================================
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 ffff888027010220 by task cifsd/6576

CPU: 0 PID: 6576 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 6573:
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 6573:
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 ffff888027010220
which belongs to the cache kmalloc-16 of size 16
The buggy address is located 0 bytes inside of
16-byte region [ffff888027010220, ffff888027010230)

The buggy address belongs to the physical page:
page:ffffea00009c0400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27010
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 dead000000000100 dead000000000122 ffff8880174413c0
raw: 0000000000000000 0000000080800080 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 4282, tgid 4282 (syz-executor), ts 94717541064, free_ts 94676580623
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
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc_node+0xa2/0x240 mm/slab_common.c:943
kmalloc_node include/linux/slab.h:589 [inline]
kvmalloc_node+0x6c/0x180 mm/util.c:581
xt_jumpstack_alloc net/netfilter/x_tables.c:1377 [inline]
xt_replace_table+0x176/0x790 net/netfilter/x_tables.c:1416
__do_replace+0x16a/0x980 net/ipv6/netfilter/ip6_tables.c:1081
do_replace net/ipv6/netfilter/ip6_tables.c:1158 [inline]
do_ip6t_set_ctl+0xb3d/0xe10 net/ipv6/netfilter/ip6_tables.c:1643
nf_setsockopt+0x25f/0x280 net/netfilter/nf_sockopt.c:101
__sys_setsockopt+0x2bf/0x3d0 net/socket.c:2288
__do_sys_setsockopt net/socket.c:2299 [inline]
__se_sys_setsockopt net/socket.c:2296 [inline]
__x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2296
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
tlb_batch_list_free mm/mmu_gather.c:76 [inline]
tlb_finish_mmu+0x13a/0x220 mm/mmu_gather.c:397
exit_mmap+0x388/0x970 mm/mmap.c:3262
__mmput+0x118/0x3a0 kernel/fork.c:1206
exit_mm+0x24d/0x350 kernel/exit.c:572
do_exit+0x958/0x2570 kernel/exit.c:874
do_group_exit+0x229/0x2e0 kernel/exit.c:1030
__do_sys_exit_group kernel/exit.c:1041 [inline]
__se_sys_exit_group kernel/exit.c:1039 [inline]
__x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1039
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:
ffff888027010100: 00 00 fc fc fa fb fc fc fa fb fc fc fb fb fc fc
ffff888027010180: fa fb fc fc 00 04 fc fc fb fb fc fc fa fb fc fc
>ffff888027010200: 00 04 fc fc fa fb fc fc fb fb fc fc fb fb fc fc
^
ffff888027010280: fa fb fc fc fb fb fc fc 00 00 fc fc fb fb fc fc
ffff888027010300: fb fb fc fc fb fb fc fc fb fb fc fc fa fb fc fc
==================================================================


---
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

syzbot

unread,
Aug 7, 2026, 12:20:25 PM (13 hours ago) Aug 7
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: aabd761612db Linux 5.15.215
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=120c2132580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f161cbc9aef65db0
dashboard link: https://syzkaller.appspot.com/bug?extid=aa3992db0ca16a888f46
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/f636f56d3662/disk-aabd7616.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f1a46620f40c/vmlinux-aabd7616.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9b78bb48b022/bzImage-aabd7616.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+aa3992...@syzkaller.appspotmail.com

CIFS: VFS: \\127.0.0.1 SMB response too short (0 bytes)
==================================================================
BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:642 [inline]
BUG: KASAN: use-after-free in string+0x204/0x290 lib/vsprintf.c:724
Read of size 1 at addr ffff8880764fca00 by task cifsd/9840

CPU: 0 PID: 9840 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/0x250 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
string_nocheck lib/vsprintf.c:642 [inline]
string+0x204/0x290 lib/vsprintf.c:724
vsnprintf+0x10db/0x1c20 lib/vsprintf.c:2811
vscnprintf lib/vsprintf.c:2914 [inline]
scnprintf+0xe5/0x180 lib/vsprintf.c:2968
reconn_set_ipaddr_from_hostname+0x112/0x580 fs/cifs/connect.c:107
__cifs_reconnect fs/cifs/connect.c:288 [inline]
cifs_reconnect+0x470/0x1350 fs/cifs/connect.c:447
cifs_demultiplex_thread+0x1eca/0x35b0 fs/cifs/connect.c:-1
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>

Allocated by task 9837:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522
kstrdup+0x32/0x70 mm/util.c:60
cifs_get_tcp_session+0xde/0x18f0 fs/cifs/connect.c:1431
mount_get_conns+0xc3/0xe00 fs/cifs/connect.c:2988
is_dfs_mount fs/cifs/connect.c:3354 [inline]
cifs_mount+0x162/0x1380 fs/cifs/connect.c:3549
cifs_smb3_do_mount+0x366/0x760 fs/cifs/cifsfs.c:895
smb3_get_tree_common fs/cifs/fs_context.c:708 [inline]
smb3_get_tree+0x59a/0xa80 fs/cifs/fs_context.c:726
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x247/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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 9837:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
cifs_put_tcp_session+0x2e1/0x3d0 fs/cifs/connect.c:1404
mount_put_conns+0xb0/0x270 fs/cifs/connect.c:2969
cifs_mount+0xbf5/0x1380 fs/cifs/connect.c:3597
cifs_smb3_do_mount+0x366/0x760 fs/cifs/cifsfs.c:895
smb3_get_tree_common fs/cifs/fs_context.c:708 [inline]
smb3_get_tree+0x59a/0xa80 fs/cifs/fs_context.c:726
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x247/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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 ffff8880764fca00
which belongs to the cache kmalloc-16 of size 16
The buggy address is located 0 bytes inside of
16-byte region [ffff8880764fca00, ffff8880764fca10)
The buggy address belongs to the page:
page:ffffea0001d93f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x764fc
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea00006d6600 0000000d0000000d ffff888016c413c0
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 4189, ts 78616301391, free_ts 78601727265
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x807/0xdd0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
slab_alloc mm/slub.c:3233 [inline]
__kmalloc+0x11d/0x340 mm/slub.c:4408
kmalloc_array include/linux/slab.h:647 [inline]
kcalloc include/linux/slab.h:676 [inline]
mq_init+0x14b/0x650 net/sched/sch_mq.c:83
qdisc_create_dflt+0x11a/0x410 net/sched/sch_generic.c:960
attach_default_qdiscs net/sched/sch_generic.c:1139 [inline]
dev_activate+0x192/0x1330 net/sched/sch_generic.c:1193
__dev_open+0x33b/0x430 net/core/dev.c:1559
__dev_change_flags+0x1e4/0x6a0 net/core/dev.c:8879
dev_change_flags+0x78/0x1a0 net/core/dev.c:8950
do_setlink+0xca4/0x29d0 net/core/rtnetlink.c:2793
__rtnl_newlink net/core/rtnetlink.c:3464 [inline]
rtnl_newlink+0x15bb/0x1920 net/core/rtnetlink.c:3586
rtnetlink_rcv_msg+0x7f1/0xf10 net/core/rtnetlink.c:5698
netlink_rcv_skb+0x1e9/0x430 net/netlink/af_netlink.c:2519
netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
netlink_unicast+0x78f/0x940 net/netlink/af_netlink.c:1340
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
free_slab mm/slub.c:2020 [inline]
discard_slab mm/slub.c:2026 [inline]
__unfreeze_partials+0x188/0x1e0 mm/slub.c:2512
put_cpu_partial+0x12d/0x190 mm/slub.c:2592
qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
kmem_cache_alloc_node+0x184/0x2c0 mm/slub.c:3261
__alloc_skb+0xf4/0x750 net/core/skbuff.c:415
alloc_skb include/linux/skbuff.h:1162 [inline]
nlmsg_new include/net/netlink.h:964 [inline]
netlink_ack+0x35c/0xb10 net/netlink/af_netlink.c:2454
netlink_rcv_skb+0x267/0x430 net/netlink/af_netlink.c:2525
netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
netlink_unicast+0x78f/0x940 net/netlink/af_netlink.c:1340
netlink_sendmsg+0x8ba/0xbe0 net/netlink/af_netlink.c:1919
sock_sendmsg_nosec net/socket.c:706 [inline]
__sock_sendmsg net/socket.c:718 [inline]
__sys_sendto+0x46d/0x620 net/socket.c:2073
__do_sys_sendto net/socket.c:2085 [inline]
__se_sys_sendto net/socket.c:2081 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2081

Memory state around the buggy address:
ffff8880764fc900: fa fb fc fc fa fb fc fc 00 00 fc fc 00 00 fc fc
ffff8880764fc980: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
>ffff8880764fca00: fa fb fc fc 00 00 fc fc fa fb fc fc fa fb fc fc
^
ffff8880764fca80: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
ffff8880764fcb00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc

syzbot

unread,
Aug 7, 2026, 7:22:42 PM (6 hours ago) Aug 7
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: aabd761612db Linux 5.15.215
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11498fb9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f161cbc9aef65db0
dashboard link: https://syzkaller.appspot.com/bug?extid=aa3992db0ca16a888f46
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11817e49580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11a0afb9580000
==================================================================
BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:642 [inline]
BUG: KASAN: use-after-free in string+0x204/0x290 lib/vsprintf.c:724
Read of size 1 at addr ffff888071136260 by task cifsd/4400

CPU: 0 PID: 4400 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/0x250 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
string_nocheck lib/vsprintf.c:642 [inline]
string+0x204/0x290 lib/vsprintf.c:724
vsnprintf+0x10db/0x1c20 lib/vsprintf.c:2811
vscnprintf lib/vsprintf.c:2914 [inline]
scnprintf+0xe5/0x180 lib/vsprintf.c:2968
reconn_set_ipaddr_from_hostname+0x112/0x580 fs/cifs/connect.c:107
__cifs_reconnect fs/cifs/connect.c:288 [inline]
cifs_reconnect+0x470/0x1350 fs/cifs/connect.c:447
cifs_demultiplex_thread+0x1eca/0x35b0 fs/cifs/connect.c:-1
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>

Allocated by task 4399:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522
kstrdup+0x32/0x70 mm/util.c:60
cifs_get_tcp_session+0xde/0x18f0 fs/cifs/connect.c:1431
mount_get_conns+0xc3/0xe00 fs/cifs/connect.c:2988
is_dfs_mount fs/cifs/connect.c:3354 [inline]
cifs_mount+0x162/0x1380 fs/cifs/connect.c:3549
cifs_smb3_do_mount+0x366/0x760 fs/cifs/cifsfs.c:895
smb3_get_tree_common fs/cifs/fs_context.c:708 [inline]
smb3_get_tree+0x59a/0xa80 fs/cifs/fs_context.c:726
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x247/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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 4399:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
cifs_put_tcp_session+0x2e1/0x3d0 fs/cifs/connect.c:1404
mount_put_conns+0xb0/0x270 fs/cifs/connect.c:2969
cifs_mount+0xbf5/0x1380 fs/cifs/connect.c:3597
cifs_smb3_do_mount+0x366/0x760 fs/cifs/cifsfs.c:895
smb3_get_tree_common fs/cifs/fs_context.c:708 [inline]
smb3_get_tree+0x59a/0xa80 fs/cifs/fs_context.c:726
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x247/0xa40 fs/namespace.c:3034
do_mount fs/namespace.c:3377 [inline]
__do_sys_mount fs/namespace.c:3585 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
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 ffff888071136260
which belongs to the cache kmalloc-16 of size 16
The buggy address is located 0 bytes inside of
16-byte region [ffff888071136260, ffff888071136270)
The buggy address belongs to the page:
page:ffffea0001c44d80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x71136
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888016c413c0
raw: 0000000000000000 0000000080800080 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 4299, ts 89404424684, free_ts 89397043492
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
__alloc_pages_node include/linux/gfp.h:570 [inline]
alloc_slab_page mm/slub.c:1782 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xb6/0x4b0 mm/slub.c:1980
___slab_alloc+0x807/0xdd0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
__kmalloc_node+0x142/0x3a0 mm/slub.c:4456
kmalloc_node include/linux/slab.h:630 [inline]
kvmalloc_node+0x84/0x130 mm/util.c:619
xt_jumpstack_alloc net/netfilter/x_tables.c:1377 [inline]
xt_replace_table+0x160/0x750 net/netfilter/x_tables.c:1416
__do_replace+0x16f/0xa00 net/ipv6/netfilter/ip6_tables.c:1081
do_replace net/ipv6/netfilter/ip6_tables.c:1158 [inline]
do_ip6t_set_ctl+0xaa4/0xd90 net/ipv6/netfilter/ip6_tables.c:1643
nf_setsockopt+0x25f/0x280 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x20ba/0x3cc0 net/ipv6/ipv6_sockglue.c:1014
tcp_setsockopt+0x229/0x1e60 net/ipv4/tcp.c:3722
__sys_setsockopt+0x2bf/0x3d0 net/socket.c:2213
__do_sys_setsockopt net/socket.c:2224 [inline]
__se_sys_setsockopt net/socket.c:2221 [inline]
__x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2221
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
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
__vunmap+0x8e0/0xa80 mm/vmalloc.c:2628
free_work+0x56/0x80 mm/vmalloc.c:95
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
ffff888071136100: 00 00 fc fc fa fb fc fc 00 00 fc fc 00 00 fc fc
ffff888071136180: 00 00 fc fc fa fb fc fc 00 06 fc fc 00 00 fc fc
>ffff888071136200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
^
ffff888071136280: 00 00 fc fc 00 00 fc fc fc fc fc fc fc fc fc fc
ffff888071136300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages