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

From: syzbot
Date: Wed Dec 27 2023 - 22:20:16 EST


Hello,

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

loop0: detected capacity change from 0 to 1024
=====================================================
BUG: KMSAN: uninit-value in hfsplus_cat_case_cmp_key+0xf1/0x190 fs/hfsplus/catalog.c:23
hfsplus_cat_case_cmp_key+0xf1/0x190 fs/hfsplus/catalog.c:23
hfs_find_rec_by_key+0xb0/0x240 fs/hfsplus/bfind.c:100
__hfsplus_brec_find+0x26b/0x7b0 fs/hfsplus/bfind.c:135
hfsplus_brec_find+0x445/0x970 fs/hfsplus/bfind.c:195
hfsplus_brec_read+0x46/0x1a0 fs/hfsplus/bfind.c:222
hfsplus_find_cat+0xdb/0x460 fs/hfsplus/catalog.c:202
hfsplus_iget+0x752/0xb00 fs/hfsplus/super.c:82
hfsplus_fill_super+0x151b/0x26f0 fs/hfsplus/super.c:503
mount_bdev+0x3d7/0x560 fs/super.c:1650
hfsplus_mount+0x4d/0x60 fs/hfsplus/super.c:641
legacy_get_tree+0x110/0x290 fs/fs_context.c:662
vfs_get_tree+0xa5/0x520 fs/super.c:1771
do_new_mount+0x68d/0x1550 fs/namespace.c:3337
path_mount+0x73d/0x1f20 fs/namespace.c:3664
do_mount fs/namespace.c:3677 [inline]
__do_sys_mount fs/namespace.c:3886 [inline]
__se_sys_mount+0x725/0x810 fs/namespace.c:3863
__x64_sys_mount+0xe4/0x140 fs/namespace.c:3863
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b

Uninit was created at:
slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
slab_alloc_node mm/slub.c:3478 [inline]
__kmem_cache_alloc_node+0x5c9/0x970 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc+0x121/0x3c0 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
hfsplus_find_init+0x91/0x250 fs/hfsplus/bfind.c:21
hfsplus_iget+0x3f3/0xb00 fs/hfsplus/super.c:80
hfsplus_fill_super+0x151b/0x26f0 fs/hfsplus/super.c:503
mount_bdev+0x3d7/0x560 fs/super.c:1650
hfsplus_mount+0x4d/0x60 fs/hfsplus/super.c:641
legacy_get_tree+0x110/0x290 fs/fs_context.c:662
vfs_get_tree+0xa5/0x520 fs/super.c:1771
do_new_mount+0x68d/0x1550 fs/namespace.c:3337
path_mount+0x73d/0x1f20 fs/namespace.c:3664
do_mount fs/namespace.c:3677 [inline]
__do_sys_mount fs/namespace.c:3886 [inline]
__se_sys_mount+0x725/0x810 fs/namespace.c:3863
__x64_sys_mount+0xe4/0x140 fs/namespace.c:3863
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b

CPU: 1 PID: 5485 Comm: syz-executor.0 Not tainted 6.7.0-rc7-syzkaller-00003-gfbafc3e621c3-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
=====================================================


Tested on:

commit: fbafc3e6 Merge tag 'for_linus' of git://git.kernel.org..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=16eca09ae80000
kernel config: https://syzkaller.appspot.com/x/.config?x=e0c7078a6b901aa3
dashboard link: https://syzkaller.appspot.com/bug?extid=50d8672fea106e5387bb
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=11e5c579e80000