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