Re: [syzbot] [hfs?] KMSAN: uninit-value in copy_name

From: syzbot
Date: Mon May 20 2024 - 23:10:14 EST


Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KMSAN: uninit-value in hfsplus_listxattr

loop0: detected capacity change from 0 to 1024
1sb: ffff888027b26c00, xnl: 762, hfsplus_listxattr
res: 1, cc: 121, op:ffff888027b26c12, len: 744, ustrlen: 0, hfsplus_uni2asc
=====================================================
BUG: KMSAN: uninit-value in string_nocheck lib/vsprintf.c:647 [inline]
BUG: KMSAN: uninit-value in string+0x36f/0x580 lib/vsprintf.c:728
string_nocheck lib/vsprintf.c:647 [inline]
string+0x36f/0x580 lib/vsprintf.c:728
vsnprintf+0x1b3b/0x2a00 lib/vsprintf.c:2824
vprintk_store+0x414/0x13f0 kernel/printk/printk.c:2228
vprintk_emit+0x1e4/0xbc0 kernel/printk/printk.c:2329
vprintk_default+0x3e/0x50 kernel/printk/printk.c:2363
vprintk+0xee/0xf0 kernel/printk/printk_safe.c:45
_printk+0x157/0x190 kernel/printk/printk.c:2373
hfsplus_listxattr+0xb53/0x1740 fs/hfsplus/xattr.c:743
vfs_listxattr fs/xattr.c:493 [inline]
listxattr+0x1f3/0x6b0 fs/xattr.c:840
path_listxattr fs/xattr.c:864 [inline]
__do_sys_listxattr fs/xattr.c:876 [inline]
__se_sys_listxattr fs/xattr.c:873 [inline]
__x64_sys_listxattr+0x16b/0x2f0 fs/xattr.c:873
x64_sys_call+0x2ba0/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:195
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was created at:
slab_post_alloc_hook mm/slub.c:3877 [inline]
slab_alloc_node mm/slub.c:3918 [inline]
kmalloc_trace+0x57b/0xbe0 mm/slub.c:4065
kmalloc include/linux/slab.h:628 [inline]
hfsplus_listxattr+0x4b6/0x1740 fs/hfsplus/xattr.c:699
vfs_listxattr fs/xattr.c:493 [inline]
listxattr+0x1f3/0x6b0 fs/xattr.c:840
path_listxattr fs/xattr.c:864 [inline]
__do_sys_listxattr fs/xattr.c:876 [inline]
__se_sys_listxattr fs/xattr.c:873 [inline]
__x64_sys_listxattr+0x16b/0x2f0 fs/xattr.c:873
x64_sys_call+0x2ba0/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:195
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

CPU: 1 PID: 5518 Comm: syz-executor.0 Not tainted 6.9.0-syzkaller-01768-ga5131c3fdf26-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
=====================================================


Tested on:

commit: a5131c3f Merge tag 'x86-shstk-2024-05-13' of git://git..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=14dc197c980000
kernel config: https://syzkaller.appspot.com/x/.config?x=64e100d74625a6a5
dashboard link: https://syzkaller.appspot.com/bug?extid=efde959319469ff8d4d7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1234ddf0980000