[syzbot] [f2fs?] KMSAN: uninit-value in f2fs_new_node_page

12 views
Skip to first unread message

syzbot

unread,
Dec 3, 2024, 10:01:33 AMDec 3
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 0e287d31b62b Merge tag 'rtc-6.13' of git://git.kernel.org/..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=117ddf78580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b131ba4658863ffa
dashboard link: https://syzkaller.appspot.com/bug?extid=5141f6db57a2f7614352
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=145a65e8580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=157ddf78580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/19a3d9ed3459/disk-0e287d31.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3473a586f547/vmlinux-0e287d31.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bfd02e5a5157/bzImage-0e287d31.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/f9968897b785/mount_0.gz

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

F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix.
F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix.
=====================================================
BUG: KMSAN: uninit-value in f2fs_new_node_page+0x14c5/0x1690 fs/f2fs/node.c:1341
f2fs_new_node_page+0x14c5/0x1690 fs/f2fs/node.c:1341
f2fs_new_inode_page+0xb6/0x100 fs/f2fs/node.c:1311
f2fs_init_inode_metadata+0x18b/0x1e40 fs/f2fs/dir.c:501
f2fs_add_inline_entry+0x5f5/0xbe0 fs/f2fs/inline.c:665
f2fs_add_dentry fs/f2fs/dir.c:742 [inline]
f2fs_do_add_link+0x4b0/0xad0 fs/f2fs/dir.c:785
f2fs_add_link fs/f2fs/f2fs.h:3628 [inline]
f2fs_symlink+0x6d5/0xf80 fs/f2fs/namei.c:641
vfs_symlink+0x1ed/0x460 fs/namei.c:4669
do_symlinkat+0x253/0x8b0 fs/namei.c:4695
__do_sys_symlink fs/namei.c:4716 [inline]
__se_sys_symlink fs/namei.c:4714 [inline]
__x64_sys_symlink+0xe0/0x140 fs/namei.c:4714
x64_sys_call+0x31ca/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:89
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Local variable new_ni created at:
f2fs_new_node_page+0xa4/0x1690 fs/f2fs/node.c:1317
f2fs_new_inode_page+0xb6/0x100 fs/f2fs/node.c:1311

CPU: 0 UID: 0 PID: 5782 Comm: syz-executor986 Not tainted 6.12.0-syzkaller-11930-g0e287d31b62b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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 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 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

syzbot

unread,
Dec 3, 2024, 11:28:53 AMDec 3
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: Re: KMSAN: uninit-value in f2fs_new_node_page()
Author: dman...@yandex.ru

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git cdd30ebb1b9f36159d66f088b61aee264e649d7a

diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h
index 6aea13024ac1..7371c09174cb 100644
--- a/fs/f2fs/node.h
+++ b/fs/f2fs/node.h
@@ -105,6 +105,7 @@ static inline bool get_nat_flag(struct nat_entry *ne, unsigned int type)

static inline void nat_reset_flag(struct nat_entry *ne)
{
+ ne->ni.flag = 0;
/* these states can be set only after checkpoint was done */
set_nat_flag(ne, IS_CHECKPOINTED, true);
set_nat_flag(ne, HAS_FSYNCED_INODE, false);
@@ -117,6 +118,7 @@ static inline void node_info_from_raw_nat(struct node_info *ni,
ni->ino = le32_to_cpu(raw_ne->ino);
ni->blk_addr = le32_to_cpu(raw_ne->block_addr);
ni->version = raw_ne->version;
+ ni->flag = 0;
}

static inline void raw_nat_from_node_info(struct f2fs_nat_entry *raw_ne,

syzbot

unread,
Dec 3, 2024, 8:42:03 PMDec 3
to dman...@yandex.ru, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+5141f6...@syzkaller.appspotmail.com
Tested-by: syzbot+5141f6...@syzkaller.appspotmail.com

Tested on:

commit: cdd30ebb module: Convert symbol namespace to string li..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11d50de8580000
kernel config: https://syzkaller.appspot.com/x/.config?x=96ee18b6611821ab
dashboard link: https://syzkaller.appspot.com/bug?extid=5141f6db57a2f7614352
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=129bc0f8580000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Dec 12, 2024, 1:03:21 PM (9 days ago) Dec 12
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: Re: KMSAN: uninit-value in f2fs_new_node_page()
Author: dman...@yandex.ru

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 231825b2e1ff6ba799c5eaf396d3ab2354e37c6b

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 0b900a7a48e5..c04ee1a7ce57 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -558,6 +558,7 @@ int f2fs_get_node_info(struct f2fs_sb_info *sbi, nid_t nid,
block_t blkaddr;
int i;

+ ni->flag = 0;
ni->nid = nid;
retry:
/* Check nat cache */

syzbot

unread,
Dec 12, 2024, 1:54:04 PM (9 days ago) Dec 12
to dman...@yandex.ru, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+5141f6...@syzkaller.appspotmail.com
Tested-by: syzbot+5141f6...@syzkaller.appspotmail.com

Tested on:

commit: 231825b2 Revert "unicode: Don't special case ignorable..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11aeecdf980000
kernel config: https://syzkaller.appspot.com/x/.config?x=95d0bb0535bcaca0
dashboard link: https://syzkaller.appspot.com/bug?extid=5141f6db57a2f7614352
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=158d0730580000
Reply all
Reply to author
Forward
0 new messages