[syzbot] [hfs?] KMSAN: uninit-value in hfs_free_fork

From: syzbot
Date: Mon May 06 2024 - 03:01:38 EST


Hello,

syzbot found the following issue on:

HEAD commit: b9158815de52 Merge tag 'char-misc-6.9-rc7' of git://git.ke..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=15154bff180000
kernel config: https://syzkaller.appspot.com/x/.config?x=bbf567496022057b
dashboard link: https://syzkaller.appspot.com/bug?extid=2e6fb1f89ce5e13cd02d
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1262fb38980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1530bdc4980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7886d49e8de8/disk-b9158815.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7909f40ff65c/vmlinux-b9158815.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7641fb86043d/bzImage-b9158815.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/aeab32d02708/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+2e6fb1f89ce5e13cd02d@xxxxxxxxxxxxxxxxxxxxxxxxx

=====================================================
BUG: KMSAN: uninit-value in __hfs_ext_read_extent fs/hfs/extent.c:160 [inline]
BUG: KMSAN: uninit-value in hfs_free_fork+0x6b4/0xa50 fs/hfs/extent.c:320
__hfs_ext_read_extent fs/hfs/extent.c:160 [inline]
hfs_free_fork+0x6b4/0xa50 fs/hfs/extent.c:320
hfs_cat_delete+0x501/0xb90 fs/hfs/catalog.c:247
hfs_remove+0x16a/0x2f0 fs/hfs/dir.c:262
vfs_unlink+0x676/0xa30 fs/namei.c:4335
do_unlinkat+0x823/0xe10 fs/namei.c:4399
__do_sys_unlink fs/namei.c:4447 [inline]
__se_sys_unlink fs/namei.c:4445 [inline]
__x64_sys_unlink+0x78/0xb0 fs/namei.c:4445
x64_sys_call+0x31c7/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:88
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:3804 [inline]
slab_alloc_node mm/slub.c:3845 [inline]
__do_kmalloc_node mm/slub.c:3965 [inline]
__kmalloc+0x6e4/0x1000 mm/slub.c:3979
kmalloc include/linux/slab.h:632 [inline]
hfs_find_init+0x91/0x250 fs/hfs/bfind.c:21
hfs_free_fork+0x3bb/0xa50 fs/hfs/extent.c:316
hfs_cat_delete+0x501/0xb90 fs/hfs/catalog.c:247
hfs_remove+0x16a/0x2f0 fs/hfs/dir.c:262
vfs_unlink+0x676/0xa30 fs/namei.c:4335
do_unlinkat+0x823/0xe10 fs/namei.c:4399
__do_sys_unlink fs/namei.c:4447 [inline]
__se_sys_unlink fs/namei.c:4445 [inline]
__x64_sys_unlink+0x78/0xb0 fs/namei.c:4445
x64_sys_call+0x31c7/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:88
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: 5043 Comm: syz-executor323 Not tainted 6.9.0-rc6-syzkaller-00290-gb9158815de52 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
=====================================================


---
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 syzkaller@xxxxxxxxxxxxxxxx.

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

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